Environment
GOPATH
Attempting to limit the scope of your Go env, you can define the follow to help you maintain tight control over your app.
GOPATH="$(pwd)/vendor:$(pwd)" GOBIN="$(pwd/bin"
Modules
Command: go mod download
Requirement: go-1.13+
(Note to self: I’ll have to double-check this)
Purpose: download go module dependencies
Command: go mod vendor
Requirement: go-1.13+
(Note to self: I’ll have to double-check this)
Purpose: create a vendor folder in the main module’s root folder and copy all dependencies into it. After this you may pass -mod=vendor
param to the go
tool. Dependencies from the vendor folder will be used to build your app.
* Despite what others may agree or disagree with, I’m calling it golang because I feel that it really helps search engines and human know they’re looking at the programming language, Go, and not trying to find search results for just “go”.