Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't go get cli cobra #1345

Closed
b1r1b1r1 opened this issue Feb 11, 2021 · 1 comment
Closed

Can't go get cli cobra #1345

b1r1b1r1 opened this issue Feb 11, 2021 · 1 comment

Comments

@b1r1b1r1
Copy link

Can't fresh install cobra CLI as in https://github.com/spf13/cobra/blob/master/cobra/README.md.

Running the command go get -u -v github.com/spf13/cobra/cobra gives the following output

github.com/spf13/cobra (download)
github.com/mitchellh/go-homedir (download)
github.com/spf13/pflag (download)
github.com/spf13/viper (download)
github.com/fsnotify/fsnotify (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
get "golang.org/x/sys/internal/unsafeheader": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/internal/unsafeheader?go-get=1
get "golang.org/x/sys/internal/unsafeheader": verifying non-authoritative meta tag
github.com/hashicorp/hcl (download)
github.com/agext/levenshtein (download)
github.com/apparentlymart/go-textseg (download)
github.com/mitchellh/go-wordwrap (download)
github.com/zclconf/go-cty (download)
get "golang.org/x/text/unicode/norm": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
golang.org/x/text (download)
get "golang.org/x/text/transform": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/transform?go-get=1
get "golang.org/x/text/transform": verifying non-authoritative meta tag
cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
        /home/xmikasax/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)
github.com/magiconair/properties (download)
github.com/mitchellh/mapstructure (download)
github.com/pelletier/go-toml (download)
github.com/spf13/afero (download)
github.com/spf13/cast (download)
github.com/spf13/jwalterweatherman (download)
github.com/subosito/gotenv (download)
get "gopkg.in/ini.v1": found meta tag get.metaImport{Prefix:"gopkg.in/ini.v1", VCS:"git", RepoRoot:"https://gopkg.in/ini.v1"} at //gopkg.in/ini.v1?go-get=1
gopkg.in/ini.v1 (download)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)

With an error

cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
        /home/xmikasax/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)
@GonzalezAndrew
Copy link

@xmikasax I was experiencing the same issue downloading cobra but I found when I set the environment variable, GO111MODULE=ON, I was then able to successfully download cobra. Hope this helps.

andy ~/go ➜  go get -u -v github.com/spf13/cobra/cobra
github.com/spf13/cobra (download)
github.com/mitchellh/go-homedir (download)
github.com/spf13/pflag (download)
github.com/spf13/viper (download)
github.com/fsnotify/fsnotify (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
get "golang.org/x/sys/internal/unsafeheader": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/internal/unsafeheader?go-get=1
get "golang.org/x/sys/internal/unsafeheader": verifying non-authoritative meta tag
github.com/hashicorp/hcl (download)
github.com/agext/levenshtein (download)
github.com/apparentlymart/go-textseg (download)
github.com/mitchellh/go-wordwrap (download)
github.com/zclconf/go-cty (download)
get "golang.org/x/text/unicode/norm": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
golang.org/x/text (download)
get "golang.org/x/text/transform": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/transform?go-get=1
get "golang.org/x/text/transform": verifying non-authoritative meta tag
cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
	/home/linuxbrew/.linuxbrew/Cellar/go/1.15.7/libexec/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
	/home/andy/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)
github.com/magiconair/properties (download)
github.com/mitchellh/mapstructure (download)
github.com/pelletier/go-toml (download)
github.com/spf13/afero (download)
github.com/spf13/cast (download)
github.com/spf13/jwalterweatherman (download)
github.com/subosito/gotenv (download)
get "gopkg.in/ini.v1": found meta tag get.metaImport{Prefix:"gopkg.in/ini.v1", VCS:"git", RepoRoot:"https://gopkg.in/ini.v1"} at //gopkg.in/ini.v1?go-get=1
gopkg.in/ini.v1 (download)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)

andy ~/go took 9s ✗  export GO111MODULE=on

andy ~/go ➜  go get -u -v github.com/spf13/cobra/cobra
go: downloading github.com/spf13/cobra v1.1.3
go: found github.com/spf13/cobra/cobra in github.com/spf13/cobra v1.1.3
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/spf13/viper v1.7.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/spf13/afero v1.1.2
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading github.com/pelletier/go-toml v1.2.0
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading github.com/spf13/jwalterweatherman v1.0.0
go: downloading gopkg.in/ini.v1 v1.51.0
go: downloading golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0
go: downloading golang.org/x/text v0.3.2
go: github.com/fsnotify/fsnotify upgrade => v1.4.9
go: gopkg.in/ini.v1 upgrade => v1.62.0
go: github.com/magiconair/properties upgrade => v1.8.4
go: github.com/spf13/afero upgrade => v1.5.1
go: github.com/spf13/jwalterweatherman upgrade => v1.1.0
go: gopkg.in/yaml.v2 upgrade => v2.4.0
go: golang.org/x/sys upgrade => v0.0.0-20210124154548-22da62e12c0c
go: github.com/pelletier/go-toml upgrade => v1.8.1
go: golang.org/x/text upgrade => v0.3.5
go: github.com/spf13/cast upgrade => v1.3.1
go: github.com/mitchellh/go-homedir upgrade => v1.1.0
go: github.com/spf13/pflag upgrade => v1.0.5
go: github.com/mitchellh/mapstructure upgrade => v1.4.1
go: github.com/spf13/viper upgrade => v1.7.1
go: downloading github.com/spf13/viper v1.7.1
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/magiconair/properties v1.8.4
go: downloading github.com/spf13/afero v1.5.1
go: downloading github.com/mitchellh/mapstructure v1.4.1
go: downloading gopkg.in/ini.v1 v1.62.0
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/pelletier/go-toml v1.8.1
go: downloading golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
go: downloading golang.org/x/text v0.3.5
golang.org/x/sys/internal/unsafeheader
github.com/spf13/cobra/cobra/tpl
github.com/hashicorp/hcl/hcl/strconv
golang.org/x/text/transform
github.com/spf13/afero/mem
github.com/mitchellh/go-homedir
github.com/spf13/jwalterweatherman
github.com/spf13/pflag
github.com/mitchellh/mapstructure
golang.org/x/sys/unix
github.com/subosito/gotenv
gopkg.in/ini.v1
github.com/spf13/cast
gopkg.in/yaml.v2
github.com/hashicorp/hcl/hcl/token
github.com/pelletier/go-toml
github.com/magiconair/properties
golang.org/x/text/unicode/norm
github.com/hashicorp/hcl/hcl/ast
github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/hcl/json/token
github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/hcl/parser
github.com/hashicorp/hcl/json/parser
github.com/hashicorp/hcl
github.com/hashicorp/hcl/hcl/printer
github.com/spf13/afero
github.com/spf13/cobra
github.com/fsnotify/fsnotify
github.com/spf13/viper
github.com/spf13/cobra/cobra/cmd
github.com/spf13/cobra/cobra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants