golang學習遇到的問題:安裝cobra

安裝cobra會自動安裝viper

所以執行如下安裝成功即可

go get -v github.com/spf13/cobra/cobra

1.當應網絡問題安裝失敗時,在https://github.com/getlantern/lantern/releases 下下載安裝藍燈代理。

2.當出現SSL錯誤時,git config --global http.sslVerify false  

如果成功,在一系列提示後

Fetching https://gopkg.in/yaml.v2?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/mitchellh/go-homedir
github.com/spf13/pflag
github.com/spf13/cobra
golang.org/x/sys/unix
github.com/fsnotify/fsnotify
github.com/hashicorp/hcl/hcl/strconv
github.com/hashicorp/hcl/hcl/token
github.com/hashicorp/hcl/hcl/ast
github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/hcl/hcl/parser
github.com/hashicorp/hcl/json/token
github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/json/parser
github.com/hashicorp/hcl
github.com/hashicorp/hcl/hcl/printer
github.com/magiconair/properties
github.com/mitchellh/mapstructure
github.com/pelletier/go-toml
github.com/spf13/afero/mem
golang.org/x/text/transform
golang.org/x/text/unicode/norm
github.com/spf13/afero
github.com/spf13/cast
github.com/spf13/jwalterweatherman
gopkg.in/yaml.v2
github.com/spf13/viper
github.com/spf13/cobra/cobra/cmd

github.com/spf13/cobra/cobra


應該就成功了。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章