Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
go-errcheck checker doesn't support multi-element $GOPATH #580
The GOPATH environment variable can be a colon-separated list of paths, which makes the mapping from filename to go package non-trivial (furthermore, in one of my projects where this is an issue, one GOPATH element is a prefix of another (github.com/cockroachdb/cockroach). Ideally the longest match should be used instead of the first match, although I haven't run into a case where this matters).
Alternately, we could just call out to the go tool:
See also kisielk/errcheck#45, which would hopefully make all of this obsolete by making errcheck work more like the other go tools.
@bdarnell Feel free to open a pull request. I won't change the corresponding code by myself, though: The current implementation is just a best guess, which tries to handle the simple case well. I don't know enough about Go—nothing actually—to properly handle