When I exec go get -u github.com/spf13/viper
, which has a dependency golang.org/x/sys
.It will auto-execute cd ${GOPATH}/src/golang.org/x/sys; git pull --ff-only
.
This is really extra no use.
My network can't reach golang.org/x/sys. So I've already used github.com/golang/sys
and put it into my GOPATH/src/golang.org/x
.Which means the auto-check(cd ${GOPATH}/src/golang.org/x/sys; git pull --ff-only
) for the progress(go get -u github.com/spf13/viper
) should be totally eliminated, because it stuck my jenkins deploy time.
More than 90% time of jenkins deployment is wasted in checks like
cd ${GOPATH}/src/golang.org/x/sys; git pull --ff-only
cd ${GOPATH}/src/golang.org/x/text; git pull --ff-only
...
Here is part of my jenkins log:
# cd /home/tonnn/go/src/golang.org/x/sys; git pull --ff-only
fatal: unable to access 'https://go.googlesource.com/sys/': Failed connect to go.googlesource.com:443; Connection timed out
package golang.org/x/sys/unix: exit status 1
# cd /home/tonnn/go/src/golang.org/x/text; git pull --ff-only
fatal: unable to access 'https://go.googlesource.com/text/': Failed connect to go.googlesource.com:443; Connection timed out
So, is there a way to only get viper
but do not check its dependencies?
viper
is only an example to show my question.I bet most of you have met this kind of question.
I'm using Go 1.9.