LabscoMCP early access ↗

Where the files go in a Go project — which directories, what the module is called, and how much structure a project of this size actually deserves.

WHEN TO USE

SCOPE

USE FOR

  • Lay out a brand-new Go project's cmd, internal, and pkg directories to fit its size.
  • Choose a Go module and package name that follows repo-matching, lowercase conventions.
  • Set up a go.work workspace for a monorepo of several related modules.
  • Structure a CLI tool that ships multiple main packages under cmd/.
  • Add the Makefile, .gitignore, and lint config a new Go project is missing.

NOT FOR

  • Restructuring existing code into this layout without changing it.