title: `go mod tidy` fails to download private GitHub repository
body: <p>Here is the response</p>
  <pre><code>not found: github.com/me/private-repo@v0.0.0-20220413034319-81fe8421f99f: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/ea2baff0eaed39430ee011ad9a011101f13b668d5fcbd9dffdfa1e0a45422b40: exit status 128:
      fatal: could not read Username for 'https://github.com': terminal prompts disabled
  Confirm the import path was entered correctly.
  If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
  </code></pre>
  <p>I have tried to add a record in <code>~/.netrc</code> with password of a freshly created GitHub Personal access token and add config in <code>~/.gitconfig</code></p>
  <pre><code>[url &quot;ssh://git@github.com/&quot;]
      insteadOf = https://github.com/
  </code></pre>
  <p>All these are not working.</p>
  <p>If I disable the sum checking by <code>GOSUMDB=off go mod tidy</code> then it works yet I don't think this is correct to me.</p>