From 7349b179a3512dab0f8b5287c5a02210bb8e2db1 Mon Sep 17 00:00:00 2001 From: Kyle Quest Date: Fri, 17 Aug 2018 18:32:23 -0700 Subject: [PATCH] pkg layout pattern examples and clarifications --- README.md | 2 +- pkg/README.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e224c04..4ced9d8 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Library code that's safe to use by external applications (e.g., `/pkg/mypublicli Other projects will import these libraries expecting them to work, so think twice before you put something here :-) -See the [`/pkg`](pkg/README.md) directory for examples. +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. ### `/vendor` diff --git a/pkg/README.md b/pkg/README.md index 2335735..75f0cbb 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -4,10 +4,23 @@ Library code that's safe to use by external applications (e.g., `/pkg/mypublicli Other projects will import these libraries expecting them to work, so think twice before you put something here :-) +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. + Examples: +* https://github.com/prometheus/prometheus/tree/master/pkg +* https://github.com/istio/istio/tree/master/pkg +* https://github.com/google/gvisor/tree/master/pkg +* https://github.com/google/syzkaller/tree/master/pkg +* https://github.com/minio/minio/tree/master/pkg +* https://github.com/heptio/ark/tree/master/pkg +* https://github.com/heptio/sonobuoy/tree/master/pkg * https://github.com/kubernetes/kubernetes/tree/master/pkg * https://github.com/moby/moby/tree/master/pkg * https://github.com/grafana/grafana/tree/master/pkg * https://github.com/influxdata/influxdb/tree/master/pkg * https://github.com/coreos/etcd/tree/master/pkg +* https://github.com/oklog/oklog/tree/master/pkg +* https://github.com/flynn/flynn/tree/master/pkg +* https://github.com/jesseduffield/lazygit/tree/master/pkg +* https://github.com/gopasspw/gopass/tree/master/pkg