Formatting fixed
diff --git a/parsemail.go b/parsemail.go
index 293433f..9b40f1c 100644
--- a/parsemail.go
+++ b/parsemail.go
@@ -218,8 +218,11 @@
htmlBody += strings.TrimSuffix(string(ppContent[:]), "\n")
case contentTypeMultipartRelated:
- tb, hb, ef, er := parseMultipartAlternative(part, params["boundary"])
- err = er
+ tb, hb, ef, err := parseMultipartAlternative(part, params["boundary"])
+ if err != nil {
+ return textBody, htmlBody, embeddedFiles, err
+ }
+
htmlBody += hb
textBody += tb
embeddedFiles = append(embeddedFiles, ef...)
@@ -376,21 +379,21 @@
return
}
-// Represents email attachment with filename, content type and data (as a io.Reader)
+// Attachment with filename, content type and data (as a io.Reader)
type Attachment struct {
Filename string
ContentType string
Data io.Reader
}
-// Represents email embedded file with content id, content type and data (as a io.Reader)
+// EmbeddedFile with content id, content type and data (as a io.Reader)
type EmbeddedFile struct {
CID string
ContentType string
Data io.Reader
}
-// Represents email with fields for all the headers defined in RFC5322 with it's attachments and
+// Email with fields for all the headers defined in RFC5322 with it's attachments and
type Email struct {
Header mail.Header
diff --git a/parsemail_test.go b/parsemail_test.go
index 6904f3b..622003e 100644
--- a/parsemail_test.go
+++ b/parsemail_test.go
@@ -382,7 +382,7 @@
}
if len(td.embeddedFiles) != len(e.EmbeddedFiles) {
- t.Errorf("[Test Case %v] Incorrect number of embedded files! Expected: %s, Got: %v.", index, len(td.embeddedFiles), len(e.EmbeddedFiles))
+ t.Errorf("[Test Case %v] Incorrect number of embedded files! Expected: %v, Got: %v.", index, len(td.embeddedFiles), len(e.EmbeddedFiles))
} else {
embeds := e.EmbeddedFiles[:]