FAQ

On 02/19/2013 09:34 PM, Johann Höchtl wrote:
The compiler shouldn't give an error about the inner found, as a value
gets assigned to, but about the outer, which gets declared but is never
explicitly assigned to.
The language specs state that a variable declaration is initialized as
zero by default[1]. Therefore, the lack of an assignment should not be
treated as an error, because a variable declared that way is still
initialized by default with a very specific value, which is predictable
and expectable.


Rui Maciel

[1] http://golang.org/ref/spec#The_zero_value

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

People

Translate

site design / logo © 2021 Grokbase