{"action":"opened","issue":{"url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/issues/1421","labels_url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/issues/1421/labels{/name}","comments_url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/issues/1421/comments","events_url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/issues/1421/events","html_url":"https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/1421","id":60253487,"number":1421,"title":"[1.0] Variables that shadow imported package names should be flagged as such","user":{"login":"dlsniper","id":607868,"avatar_url":"https://avatars.githubusercontent.com/u/607868?v=3","gravatar_id":"","url":"https://api.github.com/users/dlsniper","html_url":"https://github.com/dlsniper","followers_url":"https://api.github.com/users/dlsniper/followers","following_url":"https://api.github.com/users/dlsniper/following{/other_user}","gists_url":"https://api.github.com/users/dlsniper/gists{/gist_id}","starred_url":"https://api.github.com/users/dlsniper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlsniper/subscriptions","organizations_url":"https://api.github.com/users/dlsniper/orgs","repos_url":"https://api.github.com/users/dlsniper/repos","events_url":"https://api.github.com/users/dlsniper/events{/privacy}","received_events_url":"https://api.github.com/users/dlsniper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/labels/inspections","name":"inspections","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/milestones/16","html_url":"https://github.com/go-lang-plugin-org/go-lang-idea-plugin/milestones/1.maybe","labels_url":"https://api.github.com/repos/go-lang-plugin-org/go-lang-idea-plugin/milestones/16/labels","id":976865,"number":16,"title":"1.maybe","description":"This is a milestone to help decide which issues should be done in 1.0 initial release and which should go in the next versions.","creator":{"login":"dlsniper","id":607868,"avatar_url":"https://avatars.githubusercontent.com/u/607868?v=3","gravatar_id":"","url":"https://api.github.com/users/dlsniper","html_url":"https://github.com/dlsniper","followers_url":"https://api.github.com/users/dlsniper/followers","following_url":"https://api.github.com/users/dlsniper/following{/other_user}","gists_url":"https://api.github.com/users/dlsniper/gists{/gist_id}","starred_url":"https://api.github.com/users/dlsniper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlsniper/subscriptions","organizations_url":"https://api.github.com/users/dlsniper/orgs","repos_url":"https://api.github.com/users/dlsniper/repos","events_url":"https://api.github.com/users/dlsniper/events{/privacy}","received_events_url":"https://api.github.com/users/dlsniper/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":1,"state":"open","created_at":"2015-02-12T14:28:40Z","updated_at":"2015-03-08T11:57:14Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-03-08T11:57:14Z","updated_at":"2015-03-08T11:57:14Z","closed_at":null,"body":"The example below will fail with the following errors:\r\n\r\n```\r\nprog.go:5: imported and not used: \"time\"\r\nprog.go:10: time.Now undefined (type string has no field or method Now)\r\nprog.go:10: time.RFC3339 undefined (type string has no field or method RFC3339)\r\n```\r\n\r\nThe reason is that on like 9 we shadow the package definition by creating a variable with the same name as an imported package. The IDE should at least have a weak warning about this as now it properly flags the ```Now()``` function as being unavailable on ```time```.\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"time\"\r\n)\r\n\r\nfunc main() {\r\n\ttime := \"demo\"\r\n\tfmt.Printf(\"%s - %s\\n\", time.Now().Format(time.RFC3339), time)\r\n}\r\n```"}}