Skip to content
masterclass Buddy

Go · Command

go mod init

go mod init creates a go.mod file and sets the module path. The file describes the module and its dependency requirements.

Last updated

Syntax

go mod init module-path

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

Subscribe
  • go mod tidy
  • go get
  • go mod edit
  • module directive
  • go directive

Source: go.mod file reference. Checked 2026-11-03.