...

/

Creating the Directory Structure

Creating the Directory Structure

In this lesson, you will learn about some best practices that emerged in the Go community when building large-scale programs. Then, you'll select a directory structure for multi-git.

Common directory structures for Go programs

We identified common elements of a Go program, but, how do we go about organizing them in a directory structure? We will discuss several common approaches.

Flat single directory

The flat single directory approach has no internal structure. All the files live in the project’s root directory. This is the approach used by multi-git 0.1, and it is appropriate for very small programs.

The minimal approach

The minimal approach advocates just two top-level directories: cmd ...