golang/go

x/vgo: Private Stash repos not being "found"

jh125486 opened this issue · 6 comments

What version of Go are you using (go version)?

go version go1.10 windows/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Possibly? I'm just using go get -u golang.org/x/vgo currently.

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\jh125486\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:/Users/jh125486/go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

What did you do?

vgo build

I have a rewrite rule in my ~/.gitconfig which works for go get:

[url "ssh://git@stash.XYZ.com/"]
        insteadOf = https://stash.XYZ.com/scm/

What did you expect to see?

A generated go.mod replicating the dependencies from Gopkg.toml.

What did you see instead?

vgo: import "stash.XYZ.com/blargh/ABC" ->
        import "stash.XYZ.com/blargh/service_now": file not found

I also hit #25110, but this happens after removing the Gopkg.lock.

It's a bit different than your situation, but posting this here in case anyone else runs into it. I had an import from a private github repo. vgo build failed:
fatal: could not read Username for 'https://github.com': No error
I was on git 2.13.3. Updating to the newest version, git 2.17.0 fixed this. Now when I run vgo build a dialog box opens asking for username/password for the private repo.

rsc commented

Please try with the latest vgo. Please also post your Gopkg.lock once you get it back.

Is there a better way to update vgo then doing go get -u golang.org/x/vgo
That's just returning:

$ vgo version
go version go1.10 windows/amd64 vgo:2018-02-20.1

which is the same version I had before (ie, do I need to switch branches or tags and do a checkout).

This is my git version if it matters:

$ git version
git version 2.9.0.windows.1

Change https://golang.org/cl/120042 mentions this issue: cmd/go/internal/modfetch: fix Lookup, Import; add ImportRepoRev

Hi, with

$ vgo version
go version go1.10 darwin/amd64 vgo:2018-02-20.1

running vgo get on a private Github repo I get repository not found. The same happens trying to vgo build a project using the private repo.

The repo exists, I can clone it, access it and I have it locally on my system in $GOPATH.

Maybe I'm missing something?

rsc commented

This should be fixed as of a few minutes ago - vgo now uses basically the same code as "go get" to resolve repos. If you are still having problems, please open a new issue and mention this one in the report. (Both to shorten the comment sequence and because most people don't have permission to reopen this issue anyway.)