Where are the sources of the dependencies with Go Modules
go build$GOPATH/pkg/mod
A second issue that arises is when you want to hack one of your dependencies, for example for testing purposes.
go mod vendorgo build -mod=vendorgo$GOPATH/pkg/mod
go.mod
use replace github.com/maelvls/beers => ../beers
../beers
GO111MODULEdirenv
During the migration from GOPATH-based projects (mainly using Dep) to Go Modules, I found myself struggling with two different places: inside and outside GOPATH. All Go Modules had to be kept outside of GOPATH, which meant my projects were in different folders.
GO111MODULEexport GO111MODULE=on
direnv.envrc.envrc.envrc
# .envrc
export GO111MODULE=on
export GOPRIVATE=github.com/mycompany/.
export GOFLAGS=-mod=vendor
-mod=vendorvendorgo mod vendor