Declaration and Scope

A declaration associates a non-empty identifier with a constant, type, variable, function, label or package. Every identifier in a program must be declared.

No identifier can be declared twice in the same block, and no identifier can be declared in the file and package block.

An identifier declared in a block can be declared again in an inner block. Although the inner declaration identifier is in scope, it denotes the entity declared by the inner declaration.

declaration_scope.go