mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 05:40:50 +01:00
Refactor SetDate to use SetDateWithValue
Replaces direct time formatting in SetDate with a call to SetDateWithValue, improving code reusability and readability. The new approach centralizes date formatting logic in one method.
This commit is contained in:
parent
ea5b02bfdd
commit
ae15a12ce5
1 changed files with 1 additions and 2 deletions
3
msg.go
3
msg.go
|
@ -1087,8 +1087,7 @@ func (m *Msg) SetBulk() {
|
|||
// - https://datatracker.ietf.org/doc/html/rfc5322#section-3.3
|
||||
// - https://datatracker.ietf.org/doc/html/rfc1123
|
||||
func (m *Msg) SetDate() {
|
||||
now := time.Now().Format(time.RFC1123Z)
|
||||
m.SetGenHeader(HeaderDate, now)
|
||||
m.SetDateWithValue(time.Now())
|
||||
}
|
||||
|
||||
// SetDateWithValue sets the "Date" header for the Msg using the provided time value in a valid RFC 1123 format.
|
||||
|
|
Loading…
Reference in a new issue