klientctl uses a combination of the Go 1.5 Vendoring Experiment and the GoVendor tool. You will likely want both of these. Please refer to the respective documentation(s) as needed, but for convenience we've compiled some quick-start instructions:
After installing Go 1.5, the GO15VENDOREXPERIMENT environment variable
needs to be set to the value of 1. This environment variable tells Go
to import packages from the vendor directory first. This can be done in
your Shell RC (.bashrc, .config/fish/config.fish, etc). Example:
Bash:
export GO15VENDOREXPERIMENT=1Fish:
set -Ux GO15VENDOREXPERIMENT 1Go 1.5 handles the importing of vendored packages, but we use the tool GoVendor to handle adding packages to that directory, and pinning them to the specified versions. This can be installed simply with:
go get github.com/kardianos/govendorTo add a new package to the vendor directly, first make sure the package is in your $GOPATH, then simply run:
govendor add github.com/some/dependency
If you need to update the vendored version of a library, follow the following steps:
go get -u github.com/some/dependencygovendor update github.com/some/dependency
If you need to choose a specific commit manually, checkout that commit beforehand. Example:
cd $GOPATH/github.com/some/dependencygit checkout <commit>cd $GOPATH/github.com/your/repogovendor update github.com/some/dependency