From dfad3214cd90a4ae3a555d26c5b09dbfec778166 Mon Sep 17 00:00:00 2001 From: Kyle Quest Date: Sun, 15 Jul 2018 23:30:46 +0300 Subject: [PATCH] when it use this project layout --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9bcfe12..7f7a97f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Standard Go Project Layout -This is a basic layout for Go application projects. It represents the most common directory structure with a number of small enhancements along with several supporting directories common to any real world application. +This is a basic layout for Go application projects. It represents the most common directory structure with a number of small enhancements along with several supporting directories common to any large enough real world application. + +If you are trying to learn Go or if you are building a PoC or a toy project for yourself this project layout is an overkill. Start with something really simple (a single `main.go` file is more than enough). As your project grows keep in mind that it'll be important to make sure your code is well structured otherwise you'll end up with a messy code with lots of hidden dependencies and global state. When you have more people working on the project you'll need even more structure. That's when it's important to introduce a common way to manage packages/libraries. When you have an open source project or when you know other projects import the code from your project repository that's when it's important to have private (aka `internal`) packages and code. Clone the repository, keep what you need and delete everything else! Just because it's there it doesn't mean you have to use it all. This project layout is intentionally generic and it doesn't try to impose a specific Go package structure. -Clone the repository, keep what you need and delete everything else! - If you need help with naming, formatting and style start by running [`gofmt`](https://golang.org/cmd/gofmt/) and [`golint`](https://github.com/golang/lint). Also make sure to read these Go code style guidelines and recommendations: * https://talks.golang.org/2014/names.slide * https://golang.org/doc/effective_go.html#names