Skip to content

Commit

Permalink
typo in String()
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Apr 24, 2022
1 parent c606c5c commit eaf5e8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion email.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (em *Sender) Send(text string, params Params) error {
}

func (em *Sender) String() string {
return fmt.Sprintf("smtp://%s:%d, auth:%v, tls:%v, starttls:%v timeout:%v, content-type:%q, charset:%q",
return fmt.Sprintf("smtp://%s:%d, auth:%v, tls:%v, starttls:%v, timeout:%v, content-type:%q, charset:%q",
em.host, em.port, em.smtpUserName != "", em.tls, em.starttls, em.timeOut, em.contentType, em.contentCharset)
}

Expand Down
4 changes: 2 additions & 2 deletions email_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ func TestWriteBodyFail(t *testing.T) {

func TestSender_String(t *testing.T) {
e := NewSender("localhost", ContentType("text/html"), Port(2525), Auth("user", "pass"))
assert.Equal(t, `smtp://localhost:2525, auth:true, tls:false, starttls:false timeout:30s, content-type:"text/html", charset:"UTF-8"`,
assert.Equal(t, `smtp://localhost:2525, auth:true, tls:false, starttls:false, timeout:30s, content-type:"text/html", charset:"UTF-8"`,
e.String())

e = NewSender("localhost", ContentType("text/html"), Port(2525), TLS(true),
STARTTLS(true), TimeOut(10*time.Second))
assert.Equal(t, `smtp://localhost:2525, auth:false, tls:true, starttls:true timeout:10s, content-type:"text/html", charset:"UTF-8"`,
assert.Equal(t, `smtp://localhost:2525, auth:false, tls:true, starttls:true, timeout:10s, content-type:"text/html", charset:"UTF-8"`,
e.String())
}

Expand Down

0 comments on commit eaf5e8a

Please sign in to comment.