{"action":"closed","issue":{"url":"https://api.github.com/repos/alecthomas/gometalinter/issues/351","repository_url":"https://api.github.com/repos/alecthomas/gometalinter","labels_url":"https://api.github.com/repos/alecthomas/gometalinter/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/alecthomas/gometalinter/issues/351/comments","events_url":"https://api.github.com/repos/alecthomas/gometalinter/issues/351/events","html_url":"https://github.com/alecthomas/gometalinter/issues/351","id":258338403,"number":351,"title":"vet linter fails when run against a directory with multiple packages","user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars1.githubusercontent.com/u/442180?v=4","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-09-17T21:55:19Z","updated_at":"2017-10-16T06:44:15Z","closed_at":"2017-10-16T06:44:15Z","author_association":"COLLABORATOR","body":"\r\nTwo packages per directory is a common way of providing `example_test.go` for godoc examples, so that the examples can import the package as a user would:\r\n * https://github.com/gotestyourself/gotestyourself/tree/master/fs has both `fs` and `fs_test` package\r\n * https://github.com/decred/dcrutil/tree/master/bloom has both `bloom` and `bloom_test` packages\r\n\r\n`go vet` fails on these directories because it is called with `*.go` and from the vet docs:\r\n\r\n> vets the files named, all of which must be in the same package.\r\n\r\nUnfortunately the other argument options (directory, and package path) are not acceptable because they are recursive or don't support shadow (respectively).\r\n\r\nThe current workaround is to [exclude `example_test.go` ](https://github.com/gotestyourself/gotestyourself/blob/master/gometalinter.json#L5) however that means that the examples will not be linted at all.\r\n\r\nThe only solution I see to this problem is to fork `go vet`, add a `--no-recursive` flag, and use that fork as the vendoered linter for `vet` and `vetshadow`."}}
{"actor":{"display_login":"alecthomas"}}