Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOOS="darwin"
What did you do?
I have a private repo served over ssh, using gitolite.
That private repo is a package I want to use, at e.g. private.repo.net/user/package
. It has a folder structure like this:
README.md
a/a.go
b/b.go
My global .gitconfig
looks like this, so that go get
works:
[url "ssh://[email protected]"]
insteadOf = https://private.repo.net
In my main package my/package
, I have a go file that imports it like this:
import "private.repo.net/user/package/a"
This used to work when using the old $GOPATH
. Now I am trying to use modules instead. I run go build my/package
which should resolve dependencies and build.
What did you expect to see?
I expected it to build.
What did you see instead?
build my/package: cannot find module for path private.repo.net/user/package/a
I also tried adding it to the go.mod
file by running go get private.repo.net/user/package.git
. (NOTE: I need to use .git
so that it uses ssh.) So it now private.repo.net/user/package.git
appears in my go.mod
file.
However, when I do go build
, it still complains that "build my/package: cannot find module for path private.repo.net/user/package/a".