Re: Issue 8220 in go: cmd/vet: No warning for some statements with no effect

4 views
Skip to first unread message

g...@googlecode.com

unread,
Jun 16, 2014, 1:55:09 PM6/16/14
to golan...@googlegroups.com
Updates:
Summary: cmd/vet: No warning for some statements with no effect
Cc: adono...@google.com
Labels: Repo-Tools Release-None

Comment #1 on issue 8220 by i...@golang.org: cmd/vet: No warning for some
statements with no effect
http://code.google.com/p/go/issues/detail?id=8220

I don't think it is feasible or useful to issue this error in the compiler.

I think it might be possible in the vet tool.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

g...@googlecode.com

unread,
Dec 5, 2014, 7:16:09 PM12/5/14
to golan...@googlegroups.com

Comment #2 on issue 8220 by adono...@google.com: cmd/vet: No warning for
some statements with no effect
https://code.google.com/p/go/issues/detail?id=8220

So what's the pattern? A deferred anon function assigns to an enclosing
local that is never
used within the deferred function, and is not a named return parameter?
This isn't necessarily a bug, as it's very hard to prove that the store is
dead. Consider:
http://play.golang.org/p/5p_IUn56qA

defer/panic code is so rare (and so inherently complex) that I doubt it
would be worth looking for this pattern in vet.
Reply all
Reply to author
Forward
0 new messages