Uniqueness of identifiers
Given a set of identifiers, an identifier is called unique if it is different from every other in the set. Two identifiers are different if they are spelled differently, or if they appear in different packages and are not exported. Otherwise, they are the same.
This is pretty simple stuff, but it’s obviously worth being explicit.
foo
and bar
are obviously different identifiers.
Further, a
in package foo
, and a
in package bar
are different identifiers, because although they are spelled the same, they are not exported, and are in different packages.
Quotes from The Go Programming Language Specification Version of December 15, 2022