From 8dbd86535d0e5725384799f9ae9f6484c512146a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 24 Mar 2021 15:47:23 -0400 Subject: [PATCH] Don't return pointer from NewImageAttachment() --- activitystreams/attachment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activitystreams/attachment.go b/activitystreams/attachment.go index c2bfc2e..d221169 100644 --- a/activitystreams/attachment.go +++ b/activitystreams/attachment.go @@ -19,13 +19,13 @@ const AttachImage AttachmentType = "Image" // NewImageAttachment creates a new Attachment from the given URL, setting the // correct type and automatically detecting the MediaType based on the file // extension. -func NewImageAttachment(url string) *Attachment { +func NewImageAttachment(url string) Attachment { var imgType string extIdx := strings.LastIndexByte(url, '.') if extIdx > -1 { imgType = mime.TypeByExtension(url[extIdx:]) } - return &Attachment{ + return Attachment{ Type: AttachImage, URL: url, MediaType: imgType,