{"action":"created","issue":{"url":"https://api.github.com/repos/dominikh/go-tools/issues/191","repository_url":"https://api.github.com/repos/dominikh/go-tools","labels_url":"https://api.github.com/repos/dominikh/go-tools/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/dominikh/go-tools/issues/191/comments","events_url":"https://api.github.com/repos/dominikh/go-tools/issues/191/events","html_url":"https://github.com/dominikh/go-tools/issues/191","id":260001258,"number":191,"title":"staticcheck: detect ineffective assignments that do not involve function calls","user":{"login":"dominikh","id":39825,"avatar_url":"https://avatars0.githubusercontent.com/u/39825?v=4","gravatar_id":"","url":"https://api.github.com/users/dominikh","html_url":"https://github.com/dominikh","followers_url":"https://api.github.com/users/dominikh/followers","following_url":"https://api.github.com/users/dominikh/following{/other_user}","gists_url":"https://api.github.com/users/dominikh/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikh/subscriptions","organizations_url":"https://api.github.com/users/dominikh/orgs","repos_url":"https://api.github.com/users/dominikh/repos","events_url":"https://api.github.com/users/dominikh/events{/privacy}","received_events_url":"https://api.github.com/users/dominikh/received_events","type":"User","site_admin":false},"labels":[{"id":525281743,"url":"https://api.github.com/repos/dominikh/go-tools/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"dominikh","id":39825,"avatar_url":"https://avatars0.githubusercontent.com/u/39825?v=4","gravatar_id":"","url":"https://api.github.com/users/dominikh","html_url":"https://github.com/dominikh","followers_url":"https://api.github.com/users/dominikh/followers","following_url":"https://api.github.com/users/dominikh/following{/other_user}","gists_url":"https://api.github.com/users/dominikh/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikh/subscriptions","organizations_url":"https://api.github.com/users/dominikh/orgs","repos_url":"https://api.github.com/users/dominikh/repos","events_url":"https://api.github.com/users/dominikh/events{/privacy}","received_events_url":"https://api.github.com/users/dominikh/received_events","type":"User","site_admin":false},"assignees":[{"login":"dominikh","id":39825,"avatar_url":"https://avatars0.githubusercontent.com/u/39825?v=4","gravatar_id":"","url":"https://api.github.com/users/dominikh","html_url":"https://github.com/dominikh","followers_url":"https://api.github.com/users/dominikh/followers","following_url":"https://api.github.com/users/dominikh/following{/other_user}","gists_url":"https://api.github.com/users/dominikh/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikh/subscriptions","organizations_url":"https://api.github.com/users/dominikh/orgs","repos_url":"https://api.github.com/users/dominikh/repos","events_url":"https://api.github.com/users/dominikh/events{/privacy}","received_events_url":"https://api.github.com/users/dominikh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-09-23T11:20:19Z","updated_at":"2017-09-23T11:27:04Z","closed_at":null,"author_association":"OWNER","body":"Currently, SA4017 only detects unused values if the rhs of the assignment is a function call, but not for other expressions. That is because in the SSA form, those assignments are never represented in the first place.\r\n\r\nExample:\r\n\r\n```\r\nfunc fn1(arg int) {\r\n\tx := 1\r\n\tx = 2\r\n\tx = 3\r\n\tfmt.Println(x)\r\n}\r\n\r\nfunc fn2(arg int) {\r\n\tx := gen()\r\n\tx = gen()\r\n\tx = gen()\r\n\tfmt.Println(x)\r\n}\r\n\r\nfunc gen() int { return 0 }\r\n\r\n/*\r\nfoo.go:13:2: this value of x is never used (SA4006)\r\nfoo.go:14:2: this value of x is never used (SA4006)\r\n*/\r\n```"},"comment":{"url":"https://api.github.com/repos/dominikh/go-tools/issues/comments/331627922","html_url":"https://github.com/dominikh/go-tools/issues/191#issuecomment-331627922","issue_url":"https://api.github.com/repos/dominikh/go-tools/issues/191","id":331627922,"user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars0.githubusercontent.com/u/3576549?v=4","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"created_at":"2017-09-23T11:27:04Z","updated_at":"2017-09-23T11:27:04Z","author_association":"CONTRIBUTOR","body":"If this information is removed from the SSA representation, how are you going to retrieve it?"}}
{"actor":{"display_login":"mvdan"}}