Go Project: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
. | . | ||
├── [[#cmd|cmd]] | ├── [[#cmd|cmd]] | ||
│ | │ ├── myserver | ||
│ | │ └── myclient | ||
├── [[#pkg|pkg]] | ├── [[#pkg|pkg]] | ||
├── [[#internal|internal]] | ├── [[#internal|internal]] |
Revision as of 19:01, 14 December 2023
External
Internal
Overview
This page collects recommendation and facts about Go projects and it was mainly written with the assumption that one project lives in its own repository and contains a single module, as described in Packages, Modules, Projects and Repositories. Of course project can contain multiple modules, but that is not recommended.
Project Layout
This layout is inspired by:
. ├── cmd │ ├── myserver │ └── myclient ├── pkg ├── internal ├── Makefile ├── README.md ├── go.mod ├── go.sum └── .gitignore
Directories
cmd
The directory contains the main applications for this project. If the project has multiple executables, their code should live under their own directory, and the name of the directory should match the name of the executable.
pkg
internal
Microservice-based Project Layout
TODO
Integrate Vendoring.