Go Modules
Start a module
Inside your project folder, create a go.mod with a module path.
mkdir greeter && cd greeter
go mod init example.com/greeter
Add code and build
With a module initialized, place packages under that folder and build.
go build
go run .
Add a dependency
Import an external package, then download and record it.
go get golang.org/x/example/hello
go mod tidy
Module files
go.modlists the module path and requirementsgo.sumstores checksums—commit bothgo mod tidyremoves unused requirements- Module paths often look like repository URLs
Comments
One comment per signed-in account. Comments are saved with this page’s URL.