test(gmail): satisfy timezone date lint
This commit is contained in:
parent
2c48bd8666
commit
6bdc215191
@ -86,9 +86,9 @@ func buildRFC822(opts mailOptions, cfg *rfc822Config) ([]byte, error) {
|
||||
return nil, fmt.Errorf("invalid Subject: %w", err)
|
||||
}
|
||||
writeHeader(&b, "Subject", encodeHeaderIfNeeded(opts.Subject))
|
||||
dateLocation, err := mailDateLocation()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
dateLocation, dateErr := mailDateLocation()
|
||||
if dateErr != nil {
|
||||
return nil, dateErr
|
||||
}
|
||||
writeHeader(&b, "Date", time.Now().In(dateLocation).Format(time.RFC1123Z))
|
||||
if !hasHeader(opts.AdditionalHeaders, "Message-ID") && !hasHeader(opts.AdditionalHeaders, "Message-Id") {
|
||||
|
||||
@ -55,9 +55,9 @@ func TestBuildRFC822_DateHeaderUsesConfiguredTimezone(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("ReadMessage: %v", err)
|
||||
}
|
||||
date := msg.Header.Get("Date")
|
||||
if !strings.HasSuffix(date, "+0000") {
|
||||
t.Fatalf("expected UTC Date header, got %q", date)
|
||||
dateHeader := msg.Header.Get("Date")
|
||||
if !strings.HasSuffix(dateHeader, "+0000") {
|
||||
t.Fatalf("expected UTC Date header, got %q", dateHeader)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user