{"action":"created","issue":{"url":"https://api.github.com/repos/fatih/vim-go/issues/1227","repository_url":"https://api.github.com/repos/fatih/vim-go","labels_url":"https://api.github.com/repos/fatih/vim-go/issues/1227/labels{/name}","comments_url":"https://api.github.com/repos/fatih/vim-go/issues/1227/comments","events_url":"https://api.github.com/repos/fatih/vim-go/issues/1227/events","html_url":"https://github.com/fatih/vim-go/issues/1227","id":211185143,"number":1227,"title":"gometalinter is linting files outside of package","user":{"login":"tgrosinger","id":597386,"avatar_url":"https://avatars2.githubusercontent.com/u/597386?v=3","gravatar_id":"","url":"https://api.github.com/users/tgrosinger","html_url":"https://github.com/tgrosinger","followers_url":"https://api.github.com/users/tgrosinger/followers","following_url":"https://api.github.com/users/tgrosinger/following{/other_user}","gists_url":"https://api.github.com/users/tgrosinger/gists{/gist_id}","starred_url":"https://api.github.com/users/tgrosinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgrosinger/subscriptions","organizations_url":"https://api.github.com/users/tgrosinger/orgs","repos_url":"https://api.github.com/users/tgrosinger/repos","events_url":"https://api.github.com/users/tgrosinger/events{/privacy}","received_events_url":"https://api.github.com/users/tgrosinger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-01T19:35:49Z","updated_at":"2017-03-06T16:22:49Z","closed_at":null,"body":"### Behavior\r\n\r\n`:gometalinter` shows errors from standard library and everything else in GOPATH. Expected to just see errors from current file, or possibly from current directory.\r\n\r\n### Steps to reproduce:\r\n\r\nCreate a test `.go` file which imports something from the standard library. For example\r\n\r\n```go\r\npackage aws\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"io/ioutil\"\r\n\t\"net/http\"\r\n)\r\n\r\nfunc DoReq() {\r\n\tresp, err := http.Get(\"http://example.com/\")\r\n\tif err != nil {\r\n\t\t// handle error\r\n\t}\r\n\tdefer resp.Body.Close()\r\n\tbody, _ := ioutil.ReadAll(resp.Body)\r\n\tfmt.Println(string(body))\r\n}\r\n```\r\n\r\nSave the file, quickfix list will contain the following:\r\n\r\n```\r\nsrc/tgrosinger/test/testing.go|9 col 1 warning| exported function DoReq should have comment or be unexported (golint)\r\n/usr/local/go/src/crypto/tls/cipher_suites.go|18 col 2 warning| unused global variable could not import golang_org/x/crypto/chacha20poly1305 (cannot find package \"golang_org/x/crypto/chacha20poly1305\" in any of: (varcheck)\r\n/usr/local/go/src/crypto/tls/key_agreement.go|20 col 2 warning| unused global variable could not import golang_org/x/crypto/curve25519 (cannot find package \"golang_org/x/crypto/curve25519\" in any of: (varcheck)\r\n/usr/local/go/src/crypto/tls/cipher_suites.go|234 col 15 warning| unused global variable undeclared name: chacha20poly1305 (varcheck)\r\n/usr/local/go/src/crypto/tls/key_agreement.go|217 col 3 warning| unused global variable undeclared name: curve25519 (varcheck)\r\n/usr/local/go/src/crypto/tls/key_agreement.go|314 col 3 warning| unused global variable undeclared name: curve25519 (varcheck)\r\n/usr/local/go/src/crypto/tls/key_agreement.go|446 col 3 warning| unused global variable undeclared name: curve25519 (varcheck)\r\n/usr/local/go/src/crypto/tls/key_agreement.go|447 col 3 warning| unused global variable undeclared name: curve25519 (varcheck)\r\n/usr/local/go/src/net/http/h2_bundle.go|46 col 2 warning| unused global variable could not import golang_org/x/net/http2/hpack (cannot find package \"golang_org/x/net/http2/hpack\" in any of: (varcheck)\r\n/usr/local/go/src/net/http/h2_bundle.go|47 col 2 warning| unused global variable could not import golang_org/x/net/idna (cannot find package \"golang_org/x/net/idna\" in any of: (varcheck)\r\n```\r\n\r\ntruncated, but this goes on for about 70 lines.\r\n\r\n### Configuration\r\n\r\nRelevant section of `.vimrc`\r\n\r\n```vim\r\nlet g:go_auto_type_info = 0\r\nlet g:go_fmt_command = \"goimports\"\r\nlet g:go_metalinter_autosave = 1\r\nlet g:go_metalinter_autosave_enabled = ['vet', 'golint', 'errcheck', 'varcheck']\r\nlet g:go_metalinter_enabled = ['vet', 'golint', 'errcheck', 'varcheck', 'aligncheck', 'ineffassign', 'gosimple', 'staticcheck']\r\nlet g:go_metalinter_deadline = '10s'\r\n```\r\n\r\n* vim version: 8.0.386\r\n* vim-go version: b9c81562630e9dfc098d25814c16bedcfcf9ffa9\r\n* go version: 1.8.0\r\n* gometalinter version: https://github.com/alecthomas/gometalinter/commit/338d6edcb845ed145fdcfbaf4ffdcf00ca9ceae5\r\n"},"comment":{"url":"https://api.github.com/repos/fatih/vim-go/issues/comments/284447874","html_url":"https://github.com/fatih/vim-go/issues/1227#issuecomment-284447874","issue_url":"https://api.github.com/repos/fatih/vim-go/issues/1227","id":284447874,"user":{"login":"tgrosinger","id":597386,"avatar_url":"https://avatars2.githubusercontent.com/u/597386?v=3","gravatar_id":"","url":"https://api.github.com/users/tgrosinger","html_url":"https://github.com/tgrosinger","followers_url":"https://api.github.com/users/tgrosinger/followers","following_url":"https://api.github.com/users/tgrosinger/following{/other_user}","gists_url":"https://api.github.com/users/tgrosinger/gists{/gist_id}","starred_url":"https://api.github.com/users/tgrosinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgrosinger/subscriptions","organizations_url":"https://api.github.com/users/tgrosinger/orgs","repos_url":"https://api.github.com/users/tgrosinger/repos","events_url":"https://api.github.com/users/tgrosinger/events{/privacy}","received_events_url":"https://api.github.com/users/tgrosinger/received_events","type":"User","site_admin":false},"created_at":"2017-03-06T16:22:49Z","updated_at":"2017-03-06T16:22:49Z","body":"It has the same problem if I go into the full project directory as well. For example:\r\n\r\n`:GoPath`: \"/home/tgrosinger/exampleproject\"\r\n`:pwd`: \"/home/tgrosinger/exampleproject/src/tgrosinger\"\r\n\r\n(yes, I know my project is set up a bit weird. But we still set the GoPath and use the correct directory structure)"}}
{"actor":{"display_login":"tgrosinger"}}