title: Heroku with go and dep: `push rejected: failed to compile Go app`
body: <p>I am trying to deploy my Go Heroku app that uses <code>dep</code> to manage dependencies. However, when I attempt to push it, the logs say this.</p>
  
  <pre><code>Total 818 (delta 147), reused 0 (delta 0)
  remote: Compressing source files... done.
  remote: Building source:
  remote: 
  remote: -----&gt; Go app detected
  remote: -----&gt; Fetching jq... done
  remote: -----&gt; Fetching tq... done
  remote:  !!    
  remote:  !!    Deprecated or unsupported version of go (go1.10.1)
  remote:  !!    See https://devcenter.heroku.com/articles/go-support#go-versions for supported version information.
  remote:  !!    
  remote: -----&gt; Installing go1.10.1
  remote: -----&gt; Fetching go1.10.1.linux-amd64.tar.gz... done
  remote:  !!    Installing package '.' (default)
  remote:  !!    
  remote:  !!    To install a different package spec set 'metadata.heroku.pkg-spec' in 'Gopkg.toml'
  remote:  !!    
  remote:  !!    For more details see: https://devcenter.heroku.com/articles/go-apps-with-dep#build-configuration
  remote:  !!    
  remote: -----&gt; Fetching dep... done
  remote: -----&gt; Fetching any unsaved dependencies (dep ensure)
  remote: -----&gt; Running: go install -v -tags heroku . 
  remote: main.go:7:2: cannot find package "backend/database" in any of:
  remote:         /tmp/tmp.2P0hB8CCKz/.go/src/main/vendor/backend/database (vendor tree)
  remote:         /app/tmp/cache/go1.10.1/go/src/backend/database (from $GOROOT)
  remote:         /tmp/tmp.2P0hB8CCKz/.go/src/backend/database (from $GOPATH)
  remote: main.go:6:2: cannot find package "backend/user" in any of:
  remote:         /tmp/tmp.2P0hB8CCKz/.go/src/main/vendor/backend/user (vendor tree)
  remote:         /app/tmp/cache/go1.10.1/go/src/backend/user (from $GOROOT)
  remote:         /tmp/tmp.2P0hB8CCKz/.go/src/backend/user (from $GOPATH)
  remote:  !     Push rejected, failed to compile Go app.
  remote: 
  remote:  !     Push failed
  remote: Verifying deploy...
  remote: 
  remote: !       Push rejected to thindan.
  remote: 
  </code></pre>
  
  <p>It nags and complains about a GOPATH that is already correct on my system. I wonder why this is happening? My dep configuration file looks like this.</p>
  
  <pre><code># Gopkg.toml example
  #
  # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
  # for detailed Gopkg.toml documentation.
  #
  # required = ["github.com/user/thing/cmd/thing"]
  # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
  #
  # [[constraint]]
  #   name = "github.com/user/project"
  #   version = "1.0.0"
  #
  # [[constraint]]
  #   name = "github.com/user/project2"
  #   branch = "dev"
  #   source = "github.com/myfork/project2"
  #
  # [[override]]
  #  name = "github.com/x/y"
  #  version = "2.4.0"
  
  
  [[constraint]]
    name = "github.com/boltdb/bolt"
    version = "1.3.1"
  
  [[constraint]]
    branch = "master"
    name = "golang.org/x/crypto"
  
  [metadata.heroku]
  root-package = "backend"
  go-version = "1.10.1"
  build = ["."]
  ensure = "false"
  </code></pre>
  
  <p>What is wrong, and how can I fix it?</p>