Add layout for projects using the gb build tool for Go #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Thanks for making direnv, it's quite handy!
I've been using the gb build tool for Go on private application projects, and I keep adding this setup to my
.envrc
s. It might be slightly controversial but since it's a small thing I thought I'd submit and see if there is interest.The reason it might be slightly controversial is that
gb
doesn't actually useGOPATH
at all—it's included here because setting it facilitates use of common Go tools and their integration in editors. Without direnv, teammates got tool integration working with vim-go, GoSublime, etc. by settingGOPATH
(and possiblyPATH
) in project-local config like localvimrc or Sublime project-specific settings. After standardizing on using direnv, everyone simply starts their editor from their shell and things just work without extra editor-specific setup.Unlike the
layout_go
already in direnv, this does not extend a global sharedGOPATH
with the local project directory,gb
's ideology is that the project's localsrc
andvendor
directories comprise everything needed to build the project, so tools shouldn't be analyzing any source or library archives outside of the project.$PWD/vendor/bin
is added toPATH
for the sake of build dependencies that may install executable tools, for example the Ginkgo BDD testing framework includes aginkgo
test runner executable.To be clear, intended usage is that you already have the typical Go development setup of a globally shared
GOPATH
configured in your shell environment by default, and$GOPATH/bin
added to your path. This way you don't need to install copies ofgocode
,godoc
, etc. invendor
of every project, the global ones installed withgo get
outside of agb
project will still be on your path and work when usinglayout gb
. It should work fine if you dogo get
some of the tools while using the layout, it just might be slightly confusing that they get installed to$PWD/vendor
, which is another caveat to consider.