Set up a new Go application with a clear, scalable folder structure from day one.
Ensure consistent project layout across multiple Go repositories on your team.
Review and refactor an existing Go project's organization to match community standards.
Learn where to place different types of code (commands, libraries, internal utilities) in a Go project.
This repository is a community-maintained reference guide that shows developers how to organize the files and folders in a Go programming language project. Go (also called Golang) is a programming language made by Google, and when you start a new project in it, you face the question of where to put different types of code. This repo answers that question by providing a recommended folder structure that has become widely adopted across the Go ecosystem. The core idea is that a Go project should be split into well-named directories, each with a specific purpose. For example, the "/cmd" folder holds the entry points for your application, "/internal" holds private code that other projects cannot import, "/pkg" holds reusable library code that outside projects are welcome to use, and "/api" holds API definition files. Each directory name signals intent clearly to any developer who opens the project. This is not an official Go standard, the readme is careful to say it is a community convention, not a mandate from the Go core team. It is more like a widely-shared best practice that emerged from real-world usage across many large Go projects. Beginners are explicitly warned not to use it for small projects, since a single main.go file is fine for learning or prototyping. You would reach for this reference when starting a new Go application that is expected to grow, when joining a Go team that wants consistent structure across repositories, or when reviewing an existing Go project's layout. It does not provide runnable code; it is a documented template with explanations. The tech stack is minimal: the repository itself uses a Makefile for automation but its value is entirely in the documentation and directory structure it describes, all targeting the Go programming language and its module system.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.