title: Installing a package to GOPATH in directory with go.mod
body: <p>I would like to install a package to <code>GOPATH</code> using <code>go get</code>. This became tricky with go tooling migrated to go mod support.</p>
  
  <p>There is no problem outside of the project directory (=directory with go.mod file). In the project directory, I would expect setting <code>G0111MODULE</code> variable should do the job but it doesn't.</p>
  
  <pre><code>G0111MODULE=off go get &lt;package name&gt;
  </code></pre>
  
  <p>How I can install a package to <code>GOPATH</code> within a directory containing <code>go.mod</code> file? 
  Thank you.</p>
  
  <p><code>go env</code> output:</p>
  
  <pre><code>GO111MODULE="on"
  GOARCH="amd64"
  GOBIN=""
  GOCACHE="/Users/zb/Library/Caches/go-build"
  GOENV="/Users/zb/Library/Application Support/go/env"
  GOEXE=""
  GOFLAGS=""
  GOHOSTARCH="amd64"
  GOHOSTOS="darwin"
  GONOPROXY=""
  GONOSUMDB=""
  GOOS="darwin"
  GOPATH="/Users/zb/dev/go"
  GOPRIVATE=""
  GOPROXY="https://proxy.golang.org,direct"
  GOROOT="/usr/local/Cellar/go/1.13/libexec"
  GOSUMDB="sum.golang.org"
  GOTMPDIR=""
  GOTOOLDIR="/usr/local/Cellar/go/1.13/libexec/pkg/tool/darwin_amd64"
  GCCGO="gccgo"
  AR="ar"
  CC="clang"
  CXX="clang++"
  CGO_ENABLED="1"
  GOMOD="/Users/zb/dev/mycopmany/links/go.mod"
  CGO_CFLAGS="-g -O2"
  CGO_CPPFLAGS=""
  CGO_CXXFLAGS="-g -O2"
  CGO_FFLAGS="-g -O2"
  CGO_LDFLAGS="-g -O2"
  PKG_CONFIG="pkg-config"
  GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gf/8xg53y0j2h9d3k5g3_vvvw9m0000gn/T/go-build248955952=/tmp/go-build -gno-record-gcc-switches -fno-common"
  </code></pre>