Working with dependencies in Go

Go Modules

Creating a go.sum file

  1. Initialize the module:

    go mod init <module_name>
  2. Install dependencies:

    go get <package>
  3. After installing dependencies, go.mod and go.sum files are automatically created and updated.

  4. Fixate dependency versions:

    go mod tidy
Was this page helpful?