Skip to content
masterclass Buddy

Go · Command

go mod tidy

go mod tidy synchronizes a module's dependency files with the packages used by the module and its tests. It adds missing requirements, removes unused ones, and records needed checksums.

Last updated

Syntax

go mod tidy

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • go.mod
  • go.sum
  • go mod init
  • go build
  • go test
  • go list -m all

Source: Go Modules Reference - The Go Programming Language. Checked 2026-11-03.