title: How to Use Go Mod Download with Unreleased Pseudo-Versions
body: <p>Since golang 1.13, I've been having this issue where our docker build scripts, which fetch our dependencies using <code>go mod download</code>, fail during a git fetch if the given dependency is an unreleased pseudo-version that is on a branch. I'm currently using golang 1.15.</p>
  <p>I'm trying to integration test some changes to the referenced go package. I'll call the package <code>example-go-sdk</code>. In the git repo for <code>example-go-sdk</code>, I've created a branch and pushed some changes. Then in the golang project that uses <code>example-go-sdk</code>, I've executed:</p>
  <pre><code>go get local.url.that.utilizes.goprivate/path/example-go-sdk@824eebca783c68c5ef3cf6db35ad688ad30b58b0
  </code></pre>
  <p>where that hash is the hash of the head commit on my branch, which I've double-checked is correct and does have my changes. <em>The project compiles locally with this just fine.</em> Even the go mod download works for me.</p>
  <p>However, when doing the <code>go mod download</code> from a golang:1.15-alpine docker container (after ensuring GOPRIVATE is set correctly), I get this error:</p>
  <pre><code>go: local.url.that.utilizes.goprivate/path/example-go-sdk@v1.1.2-0.20210329043657-824eebca783c: invalid pseudo-version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/369a4408a70eeb73ab52db67cb0c1ba8eb165df174d65c9ec995526a9545424b: exit status 128:
      fatal: unresolved deltas left after unpacking
      fatal: unpack-objects failed
  </code></pre>
  <p>Is there a way to fix this? Due to some other requirements, I can't merge this branch in <code>example-go-sdk</code> to master first before trying to reference it. I've made sure the docker build is using the right version of the referencing project with the updated <code>go.mod</code> and <code>go.sum</code>, too.</p>
  <p>Even though this all works locally for me, a couple other team members also have build issues when referencing the pseudo-version, too, so I'm not sure what the deal is.</p>