title: Go build not finding vendor packages ensured with dep
body: <p>I'm running into an error where vendor packages are not being correctly resolved by go; on macOS High Sierra 10.13.6. I'll use github.com/gorilla/mux as an example package</p>
  
  <pre><code>$ echo $GOPATH
  /Users/gregorysims/go
  
  $ go version
  go version go1.11 darwin/amd64 
  
  $ go env
  GOARCH="amd64"
  GOBIN=""
  GOCACHE="/Users/gregorysims/Library/Caches/go-build"
  GOEXE=""
  GOFLAGS=""
  GOHOSTARCH="amd64"
  GOHOSTOS="darwin"
  GOOS="darwin"
  GOPATH="/Users/gregorysims/go"
  GOPROXY=""
  GORACE=""
  GOROOT="/usr/local/go"
  GOTMPDIR=""
  GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
  GCCGO="gccgo"
  CC="clang"
  CXX="clang++"
  CGO_ENABLED="1"
  GOMOD=""
  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/tb/6c5vksm558q5q4t0fxfscgy80000gp/T/go-build409352678=/tmp/go-build -gno-record-gcc-switches -fno-common"
  </code></pre>
  
  <p>I'm importing the package with</p>
  
  <pre><code>import (
      ...
      "github.com/gorilla/mux"
      ...
  )
  </code></pre>
  
  <p>When running:</p>
  
  <pre><code>go build -o out main.go
  </code></pre>
  
  <p>I get the following error for each package in vendor</p>
  
  <pre><code>main.go:6:2: cannot find package "_/Users/gregorysims/go/src/site/user/project/vendor/github.com/gorilla/mux" in any of:
  /usr/local/go/src/_/Users/gregorysims/go/src/site/user/project/vendor/github.com/gorilla/mux (from $GOROOT)
  /Users/gregorysims/go/src/_/Users/gregorysims/go/src/site/user/project/vendor/github.com/gorilla/mux (from $GOPATH)
  </code></pre>
  
  <p>The folder should be found at</p>
  
  <pre><code>/Users/gregorysims/go/src/site/user/project/vendor/github.com/gorilla/mux
  </code></pre>
  
  <p>and is present in the directory.</p>
  
  <p>Why is this being prefixed the following?</p>
  
  <pre><code>/Users/gregorysims/go/src/_
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After deleting the local project and recloning from remote, I attempted to build without having any of the dependencies downloaded. This had the expected output:</p>
  
  <pre><code>main.go:6:2: cannot find package "github.com/gorilla/mux" in any of:
  /usr/local/go/src/github.com/gorilla/mux (from $GOROOT)
  /Users/gregorysims/go/src/github.com/gorilla/mux (from $GOPATH)
  </code></pre>
  
  <p>The above error is produced only after the build command is run after <code>dep ensure</code> is run.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Creating an empty vendor directory changes the output to:</p>
  
  <pre><code>main.go:6:2: cannot find package "github.com/gorilla/mux" in any of:
  /Users/gregorysims/go/src/site/user/project/vendor/github.com/gorilla/mux (vendor tree)
  /usr/local/go/src/github.com/gorilla/mux (from $GOROOT)
  /Users/gregorysims/go/src/github.com/gorilla/mux (from $GOPATH)
  </code></pre>
  
  <p><strong>Update 3</strong></p>
  
  <p>To simulate dep I called <code>go get github.com/gorilla/mux</code> followed by:</p>
  
  <pre><code>mv $GOPATH/src/github.com/gorilla/mux $GOPATH/src/site/user/project/vendor/github.com/gorilla/mux
  </code></pre>
  
  <p>After doing so, the problem surfaces again.</p>