11 ms·
That's not a language feature though, that's a compiler feature. The Go compiler should be technically capable of doing that without breaking iota or introduci
by roganartu 8y ago
That's not a language feature though, that's a compiler feature.
The Go compiler should be technically capable of doing that without breaking iota or introducing a new feature. Have you considered raising a request for it if one doesn't already exist?
- elithrar 8y agoIt might even be best as a vet or metachecking feature. Go’s compiler toolchain does not “warn” users by design: only hard errors.
- roganartu 8y agoYeah you're right, I should've been more specific than "compiler" here. In fact, the varcheck checker in gometalinter probably even covers this use case: https://github.com/alecthomas/gometalinter/blob/master/README.md#supported-linters https://github.com/alecthomas/gometalinter/blob/master/READM...
- monocasa 8y agoPeople tend to put all kinds of random stuff in const blocks, because it looks like import blocks, and a file level thing rather than a soecific set of constants thing.