Skip to content

Commit

Permalink
Merge pull request #4 from k1LoW/fix-close
Browse files Browse the repository at this point in the history
[BREKING] Make Close() interface the same as that of httptest
  • Loading branch information
k1LoW authored Apr 26, 2022
2 parents 5ba411d + 2af081d commit 8293d97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions smtptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ func (s *Server) Messages() []*mail.Message {
return msgs
}

func (s *Server) Close() error {
if err := s.server.Close(); err != nil {
return err
}
func (s *Server) Close() {
_ = s.server.Close()
s.wg.Wait()
return nil
}
2 changes: 1 addition & 1 deletion smtptest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestServerWithAuth(t *testing.T) {
t.Fatal(err)
}
t.Cleanup(func() {
_ = ts.Close()
ts.Close()
})
addr := ts.Addr()

Expand Down

0 comments on commit 8293d97

Please sign in to comment.