Skip to content

Commit

Permalink
maint: fix envelope.go lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jhillyerd committed Feb 2, 2023
1 parent 68979de commit 03251a7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,7 @@ func (p Parser) EnvelopeFromPart(root *Part) (*Envelope, error) {
if e.Root != nil {
_ = e.Root.DepthMatchAll(func(part *Part) bool {
// Using DepthMatchAll to traverse all parts, don't care about result.
for i := range part.Errors {
// Range index is needed to get the correct address, because range value points to
// a locally scoped variable.
e.Errors = append(e.Errors, part.Errors[i])
}
e.Errors = append(e.Errors, part.Errors...)
return false
})
}
Expand Down

0 comments on commit 03251a7

Please sign in to comment.