From 3c701b2e476a7cae6bc5175b214335b007b1f21b Mon Sep 17 00:00:00 2001 From: Kyle Quest Date: Sun, 26 Aug 2018 09:54:58 -0700 Subject: [PATCH] additional references --- README.md | 10 +++++++--- pkg/README.md | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 53c46e5..b759fa0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,11 @@ If you need help with naming, formatting and style start by running [`gofmt`](ht * https://blog.golang.org/package-names * https://github.com/golang/go/wiki/CodeReviewComments -See [Go Project Layout](https://medium.com/golang-learn/go-project-layout-e5213cdcfaa2) for additional background information. +See [`Go Project Layout`](https://medium.com/golang-learn/go-project-layout-e5213cdcfaa2) for additional background information. + +More about naming and organizing packages as well as other code structure recommendations: +* [GopherCon EU 2018: Peter Bourgon - Best Practices for Industrial Programming](https://www.youtube.com/watch?v=PTE4VJIdHPg) +* [GopherCon Russia 2018: Ashley McNamara + Brian Ketelsen - Go best practices.](https://www.youtube.com/watch?v=MzTcsI6tn-0) ## Go Directories @@ -38,9 +42,9 @@ Put your actual application code in the `/internal/app` directory (e.g., `/inter ### `/pkg` -Library code that's safe to use by external applications (e.g., `/pkg/mypubliclib`). +Library code that's ok to use by external applications (e.g., `/pkg/mypubliclib`). Other projects will import these libraries expecting them to work, so think twice before you put something here :-) -Other projects will import these libraries expecting them to work, so think twice before you put something here :-) +It's also a way to group Go code in one place when your root directory contains lots of non-Go components and directories making it easier to run various Go tool (as mentioned in the [`Best Practices for Industrial Programming`](https://www.youtube.com/watch?v=PTE4VJIdHPg) from GopherCon EU 2018). See the [`/pkg`](pkg/README.md) directory if you want to see which popular Go repos use this project layout pattern. This is a common layout pattern, but it's not universally accepted and some in the Go community don't recommend it. diff --git a/pkg/README.md b/pkg/README.md index 75f0cbb..d4b6472 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -1,8 +1,8 @@ # `/pkg` -Library code that's safe to use by external applications (e.g., `/pkg/mypubliclib`). +Library code that's ok to use by external applications (e.g., `/pkg/mypubliclib`). Other projects will import these libraries expecting them to work, so think twice before you put something here :-) -Other projects will import these libraries expecting them to work, so think twice before you put something here :-) +It's also a way to group Go code in one place when your root directory contains lots of non-Go components and directories making it easier to run various Go tool (as mentioned in the [`Best Practices for Industrial Programming`](https://www.youtube.com/watch?v=PTE4VJIdHPg) from GopherCon EU 2018). Note that this is not a universally accepted pattern and for every popular repo that uses it you can find 10 that don't. It's up to you to decide if you want to use this pattern or not. Regardless of whether or not it's a good pattern more people will know what you mean than not. It is a bit confusing for new Go devs, but it's a pretty simple confusion to resolve and that's one of the goals for this project layout repo.