From 4e7082a54065c7fef762ff76d69855594ee20550 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 28 Jun 2024 13:49:21 +0200 Subject: [PATCH] Rename WithContentID to WithFileContentID In the eml.go and file.go files, the function WithContentID has been renamed to WithFileContentID. This aligns more accurately with the function purpose, which is to set the content ID for a File object. --- eml.go | 2 +- file.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eml.go b/eml.go index 844a5ad..ed20d0d 100644 --- a/eml.go +++ b/eml.go @@ -405,7 +405,7 @@ func parseEMLAttachmentEmbed(contentDisposition []string, multiPart *multipart.P } case "inline": if contentID, _ := parseMultiPartHeader(multiPart.Header.Get(HeaderContentID.String())); contentID != "" { - if err := msg.EmbedReader(filename, dataReader, WithContentID(contentID)); err != nil { + if err := msg.EmbedReader(filename, dataReader, WithFileContentID(contentID)); err != nil { return fmt.Errorf("failed to embed multipart body: %w", err) } return nil diff --git a/file.go b/file.go index a759b3d..45e142a 100644 --- a/file.go +++ b/file.go @@ -22,8 +22,8 @@ type File struct { Writer func(w io.Writer) (int64, error) } -// WithContentID sets the Content-ID header for the File -func WithContentID(id string) FileOption { +// WithFileContentID sets the Content-ID header for the File +func WithFileContentID(id string) FileOption { return func(f *File) { f.Header.Set(HeaderContentID.String(), id) }