dgryski / semgrep-go

Go rules for semgrep and go-ruleguard
MIT License
457 stars 37 forks source link

io.Seek: Check argument order #23

Closed dwbuiten closed 3 years ago

dwbuiten commented 3 years ago

Since the io.Seek constants are just integers, you can accidentally call io.Seek with its arguments in the wrong order, and the Go compiler will not complain.

dgryski commented 3 years ago

staticcheck should catch this? https://staticcheck.io/docs/checks#SA1013

dwbuiten commented 3 years ago

I wasn't even aware that staticcheck existed, to be honest. Guess I don't keep up with the sheer number of linters and tools that exist for Go nowadays (not that I know how one would).

Kind of a pain to have this stuff spread over a whole bunch of different tools.

Will close this PR.

dgryski commented 3 years ago

staticcheck is currently one of the best static analysis tools for Go. Glad I could introduce you to it.