From 0b105048e654fd48517958de9280b06330d402bd Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 6 Oct 2024 16:21:37 +0200 Subject: [PATCH] Refine WriteToTempFile docstring Clarify the documentation for WriteToTempFile to better explain its functionality, ensure consistency, and detail its return values. --- msg_totmpfile.go | 10 ++++++++-- msg_totmpfile_116.go | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/msg_totmpfile.go b/msg_totmpfile.go index 44c427d..b7d2ada 100644 --- a/msg_totmpfile.go +++ b/msg_totmpfile.go @@ -12,8 +12,14 @@ import ( "os" ) -// WriteToTempFile will create a temporary file and output the Msg to this file -// The method will return the filename of the temporary file +// WriteToTempFile creates a temporary file and writes the Msg content to this file. +// +// This method generates a temporary file with a ".eml" extension, writes the Msg to it, and returns the +// filename of the created temporary file. +// +// Returns: +// - A string representing the filename of the temporary file. +// - An error if the file creation or writing process fails. func (m *Msg) WriteToTempFile() (string, error) { f, err := os.CreateTemp("", "go-mail_*.eml") if err != nil { diff --git a/msg_totmpfile_116.go b/msg_totmpfile_116.go index 4611106..bb93411 100644 --- a/msg_totmpfile_116.go +++ b/msg_totmpfile_116.go @@ -12,8 +12,14 @@ import ( "io/ioutil" ) -// WriteToTempFile will create a temporary file and output the Msg to this file -// The method will return the filename of the temporary file +// WriteToTempFile creates a temporary file and writes the Msg content to this file. +// +// This method generates a temporary file with a ".eml" extension, writes the Msg to it, and returns the +// filename of the created temporary file. +// +// Returns: +// - A string representing the filename of the temporary file. +// - An error if the file creation or writing process fails. func (m *Msg) WriteToTempFile() (string, error) { f, err := ioutil.TempFile("", "go-mail_*.eml") if err != nil {