Re: [go-nuts] Unused var written in closure

2016-07-03 Thread Gordon Klaus
Ok, so strictly speaking there is no bug. Both gc and gccgo are spec-compliant; gc just opts not to raise an error in this case. (One might say it is a bug that gc doesn't raise the error consistently, but I don't think the spec says anything about consistency, only optionality.) In any case, I

Re: [go-nuts] Unused var written in closure

2016-07-02 Thread gordon . klaus
More generally, this is https://github.com/golang/go/issues/10989. Such ineffectual assignments can be detected using https://github.com/gordonklaus/ineffassign. An analysis showed that only a small fraction of such were bugs, making the backwards-incompatible language change not worthwhile. @