On Fri, Dec 1, 2017 at 8:38 AM, <peter.l...@transitpros.com> wrote: > > Go will throw an error when a variable isnt 'used' ( which is often the case > when developing ), but will not throw errors if the code has unnecessary > loops, logical errors, or other more serious problems. This does not make > the code better, nor the coder magically reflect on how their code can be > improved. It just makes development more annoying when you have to go back > and forward and comment and change code just to please a compiler. We can > all agree that a := 0 not being used at the moment is much less of a > problem than slow sloppy code that Go deems as perfectly OK. If anything, a > var not being used should give me a Warning so im aware of the problem. It > almost seems as if Go was developed by non-developers.
This has been discussed many times in the past. See the mailing list archives. One reason for this error that you didn't mention is to cut down on the number of times that people get confused by shadowing of variables when using `:=`. See https://golang.org/issue/377. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.