3 ms·
fmt.Println("foo") I don't see errcheck complaining there how about (taken from here: (https://www.reddit.com/r/programming/comments/ak305l/goodbye_world_the_
by apta 8y ago
fmt.Println("foo")
I don't see errcheck complaining there
how about (taken from here: (https://www.reddit.com/r/programming/comments/ak305l/goodbye_world_the_perils_of_relying_on_output/ef28swk/ https://www.reddit.com/r/programming/comments/ak305l/goodbye...):
r1, err := fn1()
r2, err = fn2()
if err != nil {
return err
}
err check doesn't complain either
- oconnor663 8y agoThat second example is really surprising. This sort of thing happens all the time in production when lines get moved around. Does anyone know why errcheck misses it?
- agnivade 8y agoNot sure about that. But https://github.com/gordonklaus/ineffassign https://github.com/gordonklaus/ineffassign catches that.