dominikh / go-tools

Staticcheck - The advanced Go linter
https://staticcheck.dev
MIT License
6.13k stars 373 forks source link

simple: suggest bytes.Equal instead of reflect.DeepEqual #247

Open dominikh opened 6 years ago

dominikh commented 6 years ago

As seen in https://github.com/jedisct1/dnscrypt-proxy/blob/b076e01f7afe6d2f625c00c7ffb78caf813c56ac/certs.go#L48

dgryski commented 6 years ago

There's probably a few other types you could avoid using DeepEqual to compare, but it's not clear how frequently they would come up. Maybe make some rules a about when DeepEqual is overkill.

mvdan commented 6 years ago

Ah, gotta love the if boolExpr == false too.