Today, when using glide to install golang project dependencies, an error is reported as follows: (the second time, make a record today)
[ERROR] Failed to set version on golang.org/x/sys/unix to : Cannot detect VCS [ERROR] Failed to set version on golang.org/x/text/transform to : Cannot detect VCS [ERROR] Failed to set version on golang.org/x/text/unicode/norm to : Cannot detect VCS [ERROR] Failed to set references: Cannot detect VCS
1, Solution:
Modify the glide.yaml configuration file
Original profile:
- package: github.com/hzwy23/quicksort - package: github.com/mitchellh/go-homedir version: ~1.0.0 - package: github.com/spf13/cobra version: ~0.0.3 - package: github.com/spf13/viper version: ~1.1.0
Modified profile:
- package: github.com/hzwy23/quicksort - package: github.com/mitchellh/go-homedir version: ~1.0.0 - package: github.com/spf13/cobra version: ~0.0.3 - package: github.com/spf13/viper version: ~1.1.0 - package: golang.org/x/sys repo: https://github.com/golang/sys vcs: git subpackages: - unix - package: golang.org/x/text repo: https://github.com/golang/text vcs: git subpackages: - transform - unicode
After modification, execute glide install again and it will be OK
The same is true for other similar processing principles, such as using the configuration image method:
$ rm -rf ~/.glide $ mkdir -p ~/.glide $ glide mirror set https://golang.org/x/mobile https://github.com/golang/mobile --vcs git $ glide mirror set https://golang.org/x/crypto https://github.com/golang/crypto --vcs git $ glide mirror set https://golang.org/x/net https://github.com/golang/net --vcs git $ glide mirror set https://golang.org/x/tools https://github.com/golang/tools --vcs git $ glide mirror set https://golang.org/x/text https://github.com/golang/text --vcs git $ glide mirror set https://golang.org/x/image https://github.com/golang/image --vcs git $ glide mirror set https://golang.org/x/sys https://github.com/golang/sys --vcs git //Then execute in the project $ glide init $ glide install
2, Agent setting method:
export GOROOT=/usr/local/go export PATH=$PATH:$GOROOT/bin export GOPATH=$HOME/go alias setproxy="export ALL_PROXY=socks5://127.0.0.1:1080" alias unsetproxy="unset ALL_PROXY" alias ip="curl -i http://ip.cn"
In recent years, the public numbers are rarely updated, but blogs are constantly being updated, and little buddies can collect their blog addresses.