I have the latest versions of cobra & pflags.
# github.com/spf13/cobra
./command.go:508: c.Flags().ArgsLenAtDash undefined (type *pflag.FlagSet has no field or method ArgsLenAtDash)
./command.go:1145: c.Flags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
./command.go:1150: c.PersistentFlags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
./command.go:1156: c.LocalFlags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
./command.go:1162: c.InheritedFlags().HasAvailableFlags undefined (type *pflag.FlagSet has no field or method HasAvailableFlags)
nvm
@icholy:
I got the same error message, how did you fix the problem? I'm using cobra as vendored dependency with the latest master.
Okay, found the solution myself. I forgot to delete ~/.go/{src/pkg}/github.com/spf13/cobra
@klingtnet I had an old version of pflags. I deleted it and did go-get again.
@icholy Thanks for the reply, I've used cobra as a vendored dependency.
Ran into this too (when updating Hugo, which uses Cobra, which uses Pflag).
go get -u github.com/spf13/pflag
This should also work to update all the dependencies of the package you're in and its subdirectories:
go get -u -v ./...
Most helpful comment
Ran into this too (when updating Hugo, which uses Cobra, which uses Pflag).
This should also work to update all the dependencies of the package you're in and its subdirectories: