Skip to content

Commit

Permalink
Formatting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanKasan committed Apr 18, 2017
1 parent 45ca264 commit 1a96648
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions parsemail.go
Expand Up @@ -218,8 +218,11 @@ func parseMultipartAlternative(msg io.Reader, boundary string) (textBody, htmlBo

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...)
Expand Down Expand Up @@ -376,21 +379,21 @@ func decodeAttachment(part *multipart.Part) (at Attachment, err error) {
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

Expand Down
2 changes: 1 addition & 1 deletion parsemail_test.go
Expand Up @@ -382,7 +382,7 @@ So, "Hello".`,
}

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[:]

Expand Down

0 comments on commit 1a96648

Please sign in to comment.