A Go module is a project boundary initialized with go mod init and recorded in a go.mod file. Go code runs inside modules, whose names commonly match the repository path. section 2.1 section 8.1.2
Use a module as the starting point for different kinds of Go projects:
- Create a fresh application directory, initialize its module, and add main.go with package main. section 2.1 section 3.1
- Place a library package at the module root when you want users to import it with a short path. section 7.1.2
- Keep a command-line tool's main.go at the module root when it exposes one binary; use cmd/{binary_name} for several binaries. section 6.1
- Organize a simple CLI with main.go at the root and supporting code in an internal directory. section 9.2.1
Initialize a service module
Create a project directory and run `go mod init learngo/httpgordle`. After go.mod appears, add a main function, run the service with `go run .`, and test it at `http://localhost:8080`. section 8.1.2
> go mod init example.com/your-repository
Use the initialization command as the first executable step when starting a module; replace the example path with the chosen package or repository name. section 2.1



