Skip to content

Commit 191b274

Browse files
committed
#72 Initialize the permessage, keystrings, readslices, esmtpreply, and anotherset using make()
1 parent 17e69fe commit 191b274

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lhost/via-sendmail.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ func init() {
4848
"message": []string{" ----- Transcript of session follows -----"},
4949
"error": []string{"... while talking to "},
5050
}
51-
permessage := map[string]string{} // Store values of each Per-Message field
52-
keystrings := []string{} // Key list of permessage
51+
permessage := make(map[string]string, 4) // Store values of each Per-Message field
52+
keystrings := make([]string, 0, 4) // Key list of permessage
5353
dscontents := []sis.DeliveryMatter{{}}
5454
emailparts := rfc5322.Part(&bf.Payload, boundaries, false)
55-
readcursor := uint8(0) // Points the current cursor position
56-
readslices := []string{""} // Copy each line for later reference
57-
recipients := uint8(0) // The number of 'Final-Recipient' header
58-
thecommand := "" // An SMTP command name begins with the string ">>>"
59-
esmtpreply := []string{} // Reply messages from the remote server on an SMTP session
60-
sessionerr := false // Flag, true if it is an SMTP session error
61-
anotherset := map[string]string{} // Another error information
55+
readcursor := uint8(0) // Points the current cursor position
56+
readslices := make([]string, 0, 64) // Copy each line for later reference
57+
recipients := uint8(0) // The number of 'Final-Recipient' header
58+
thecommand := "" // An SMTP command name begins with the string ">>>"
59+
esmtpreply := make([]string, 0, 4) // Reply messages from the remote server on an SMTP session
60+
sessionerr := false // Flag, true if it is an SMTP session error
61+
anotherset := make(map[string]string, 4) // Another error information
6262
v := &(dscontents[len(dscontents) - 1])
6363

6464
for j, e := range(strings.Split(emailparts[0], "\n")) {

0 commit comments

Comments
 (0)