Open alingse opened 8 months ago
FYI the example you are using:
for _, n := range ns {
rs = append(rs, n)
rs = append(rs, ns...)
}
The 2 lines are wrong, in this context the right code is to remove the for
:
rs = append(rs, ns...)
A better example could be:
for _, n := range ns {
if v == "value" {
rs = append(rs, n) // OK
rs = append(rs, ns...) // Bug
}
}
I want to collect 10 or 100 real world bugs and try add it to golangci-lint
TimeParse
RangeAppendAll