Quidest?

Exported Identifiers in Go

· Lorenzo Drumond

Names with initial capital letters have a special meaning in Go.

Anything with such a name is available outside the package where it’s defined (it’s exported).

If you define a type, function, variable or anything else whose name starts with a lowercase letter, it is unexported and you won’t be able to refer to it in code that’s outside this package.

Exported names are things that the package intends to be public, while unexported names are things meant to be private (the package is going to use internally)

References

#programming #type #golang #composite #struct #github #for_the_love_of_go #capital_letter #packages #documentation #modules