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
I am receiving the below 'undefined' errors when trying to complile a new Cobra app:
$ go build
# github.com/spf13/cobra
../../spf13/cobra/command.go:419: fs.ShorthandLookup undefined (type *pflag.FlagSet has no field or method ShorthandLookup)
../../spf13/cobra/command.go:1124: c.lflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
../../spf13/cobra/command.go:1124: c.Flags().SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
../../spf13/cobra/command.go:1281: c.parentsPflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
I was able to narrow it down to two commits using git-bisect:
fs.ShorthandLookup undefined (type *pflag.FlagSet has no field or method ShorthandLookup)
4061f41c9aacfb1d66b941fefab8a3e900964217 is the first bad commit
commit 4061f41c9aacfb1d66b941fefab8a3e900964217
Author: Albert Nigmatzianov <[email protected]>
Date: Fri May 5 08:08:38 2017 +0200
Use pflag.ShorthandLookup
:100644 100644 bb26d200c0ffa2326dd732fd9eb701c589cdac02 4bf1e241471d9b41716301c85af5b474865d45d9 M command.go
c.lflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
6202b5942b8f31501d14d8cb192790d8a10302f4 is the first bad commit
commit 6202b5942b8f31501d14d8cb192790d8a10302f4
Author: Albert Nigmatzianov <[email protected]>
Date: Wed Apr 5 18:44:50 2017 +0200
Refactor flags mechanisms
I think It's more obvious now to understand the inheritance of flags. Fix #403 Fix #404 Performance improvements: benchmark old ns/op new ns/op delta BenchmarkInheritedFlags-4 6536 5595 -14.40% BenchmarkLocalFlags-4 3193 3235 +1.32% benchmark old allocs new allocs delta BenchmarkInheritedFlags-4 49 39 -20.41% BenchmarkLocalFlags-4 23 21 -8.70% benchmark old bytes new bytes delta BenchmarkInheritedFlags-4 2040 1000 -50.98% BenchmarkLocalFlags-4 1008 544 -46.03%:100644 100644 46887fd7d141d2904137dd0d40fe103bd3b2aada 6c443e7a0025fbc6b858de103381a061275b6612 M cobra_test.go:100644 100644 50bd3bb78464f7752643e5e6077574ec37215bbd a4366562f623b6b8b7bcdbe1d6958d9d643d6723 M command.go
In the meantime I have been developing off of a3cd8ab.
The text was updated successfully, but these errors were encountered:
I am receiving the below 'undefined' errors when trying to complile a new Cobra app:
I was able to narrow it down to two commits using
git-bisect
:Debugging with
git-bisect
fs.ShorthandLookup undefined (type *pflag.FlagSet has no field or method ShorthandLookup)
c.lflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
In the meantime I have been developing off of a3cd8ab.
The text was updated successfully, but these errors were encountered: