The go.mod file
go.mod is the module manifest:
module example.com/myapp
go 1.22
require github.com/x/y v1.2.3
It pins the module path, the Go version, and required dependencies with their exact versions.
Package conventions
Follow Go package conventions:
- One package per directory
- Package name matches the directory
- Export only what other code needs
package utils
func helper() {}
Clean boundaries make code readable and testable.