We look at how packages in Go work as a namespace: why a call like
fmt.Println(
"hello") is “the name before the dot”, how the
package line binds files into one module, what package-level scope is, and why files in the same folder with the same
package can see each other’s declarations. We will also discuss the role of
package
main and the
main() function, the export rule based on the first letter (uppercase/lowercase), the public API convention, and practical naming rules, including typical mistakes such as a variable named
fmt that “breaks” package imports.