mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-25 23:15:08 +01:00
Update range loop to improve msg function readability
Converted the range loop in the GetAddrHeaderString function in msg.go to use value semantics rather than index notation. This improves code clarity by not unnecessarily referring to m.addrHeader[h] in the loop and instead referencing the value directly (using variable mh), making it easier to understand and maintain.
This commit is contained in:
parent
bb18ef9e93
commit
1a166770b7
1 changed files with 2 additions and 2 deletions
4
msg.go
4
msg.go
|
@ -593,8 +593,8 @@ func (m *Msg) GetAddrHeader(h AddrHeader) []*mail.Address {
|
||||||
// GetAddrHeaderString returns the address string of the requested address header of the Msg
|
// GetAddrHeaderString returns the address string of the requested address header of the Msg
|
||||||
func (m *Msg) GetAddrHeaderString(h AddrHeader) []string {
|
func (m *Msg) GetAddrHeaderString(h AddrHeader) []string {
|
||||||
var al []string
|
var al []string
|
||||||
for i := range m.addrHeader[h] {
|
for _, mh := range m.addrHeader[h] {
|
||||||
al = append(al, m.addrHeader[h][i].String())
|
al = append(al, mh.String())
|
||||||
}
|
}
|
||||||
return al
|
return al
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue