You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is anyone else seeing this when doing a go get github.com/spf13/cobra/cobra
# github.com/spf13/cobra
../../gocode/src/github.com/spf13/cobra/bash_completions.go:369: flag.NoOptDefVal undefined (type *pflag.Flag has no field or method NoOptDefVal)
../../gocode/src/github.com/spf13/cobra/bash_completions.go:383: flag.NoOptDefVal undefined (type *pflag.Flag has no field or method NoOptDefVal)
../../gocode/src/github.com/spf13/cobra/bash_completions.go:397: flag.NoOptDefVal undefined (type *pflag.Flag has no field or method NoOptDefVal)
../../gocode/src/github.com/spf13/cobra/bash_completions.go:599: flags.SetAnnotation undefined (type *pflag.FlagSet has no field or method SetAnnotation)
../../gocode/src/github.com/spf13/cobra/bash_completions.go:623: flags.SetAnnotation undefined (type *pflag.FlagSet has no field or method SetAnnotation)
../../gocode/src/github.com/spf13/cobra/bash_completions.go:629: flags.SetAnnotation undefined (type *pflag.FlagSet has no field or method SetAnnotation)
../../gocode/src/github.com/spf13/cobra/command.go:508: c.Flags().ArgsLenAtDash undefined (type *pflag.FlagSet has no field or method ArgsLenAtDash)
../../gocode/src/github.com/spf13/cobra/command.go:530: c.Flags().GetBool undefined (type *pflag.FlagSet has no field or method GetBool)
../../gocode/src/github.com/spf13/cobra/command.go:1145: c.Flags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
../../gocode/src/github.com/spf13/cobra/command.go:1150: c.PersistentFlags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
../../gocode/src/github.com/spf13/cobra/command.go:1150: too many errors
I have the similar issue but when I tried to solve the problem with the solution given by @eparis, although it has been way too long since the answer has been posted.
I got the following error:
go: downloading github.com/spf13/cobra v1.7.0
go: module github.com/spf13/cobra@upgrade found (v1.7.0), but does not contain package github.com/spf13/cobra/cobra
And I found the solution to the error that I received:
From this Reddit post
But when try that solution the cobra gets installed but I cannot use the cobra command as it says, command not recognized.
I have explained in details about the problem and the steps that I took to solve the problem Stack overflow
I am stuck, Any suggestion or response will be appriciated.
thank you.
Update
I found the answer, which was to add the $GOPATH/bin to the path.
Activity
eparis commentedon Dec 4, 2015
I think you need to
go get github.com/spf13/cobra/cobrarobvdl commentedon Dec 4, 2015
Yeah just found that, thanks, it's in a subfolder
jrodriguezjr commentedon Jun 13, 2016
is anyone else seeing this when doing a
go get github.com/spf13/cobra/cobraeparis commentedon Jun 13, 2016
@jrodriguezjr
go get -u github.com/spf13/cobra/pflagjrodriguezjr commentedon Jun 13, 2016
@eparis That worked. Thanks!
0x2f0 commentedon Jun 24, 2023
I have the similar issue but when I tried to solve the problem with the solution given by @eparis, although it has been way too long since the answer has been posted.
I got the following error:
And I found the solution to the error that I received:
From this Reddit post
But when try that solution the cobra gets installed but I cannot use the cobra command as it says, command not recognized.
I have explained in details about the problem and the steps that I took to solve the problem
Stack overflow
I am stuck, Any suggestion or response will be appriciated.
thank you.
Update
I found the answer, which was to add the
$GOPATH/binto the path.