src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 542 forks source link

Failing to clone repository. Error: undefined: proxy.Dial #1189

Closed liamchampton closed 5 years ago

liamchampton commented 5 years ago

Subject of the issue When attempting to do a basic import of the package to clone a repository it is failing to compile, displaying a package error. # github.com/.../vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh/common.go:147:15: undefined: proxy.Dial

Latest commit related to this: https://github.com/src-d/go-git/commit/bbc05c7e371c19c3d85bf394b24061096a2b9a25

Environment go version go1.12.4 darwin/amd64:

Steps to reproduce the behaviour: 1) Use dep ensure -v to import the package into a project 2) Use the example code in the readme to clone a repo into the current directory

_, err := git.PlainClone("./", false, &git.CloneOptions{
    URL:      "https://github.com/src-d/go-git",
    Progress: os.Stdout,
})
mcuadros commented 5 years ago

We don't support dep and I don't know what mesh is doing with the dependencies.

digininja commented 5 years ago

Your problem is that your golang.org/x/net/proxy package is out of date. To fix it:

cd ~/go/src/golang.org/x/net/proxy
go get -u -v

You should then see some updates happen and then things should work.

dougsanders commented 4 years ago

I am building in a docker container. The above solution worked intermittently for some reason that I am unable to explain. Just in case someone else runs into this, explicitly pull it into the vendor folder worked for me.

dep ensure -add "golang.org/x/net/proxy"