mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Fix TestGlobalNormFuncPropagation() on gccgo
According to golang/go#9504 and https://golang.org/pkg/reflect/#Value, == should not be used on two reflect.Values, but comparing the results of their Interface() method does not work in this case, so let's compare the results of their Pointer() method instead. See https://stackoverflow.com/questions/9643205/how-do-i-compare-two-functions-for-pointer-equality-in-the-latest-go-weekly
This commit is contained in:
parent
90fc11bbc0
commit
34594c771f
1 changed files with 1 additions and 1 deletions
|
@ -1166,7 +1166,7 @@ func TestGlobalNormFuncPropagation(t *testing.T) {
|
||||||
|
|
||||||
rootCmd := initialize()
|
rootCmd := initialize()
|
||||||
rootCmd.SetGlobalNormalizationFunc(normFunc)
|
rootCmd.SetGlobalNormalizationFunc(normFunc)
|
||||||
if reflect.ValueOf(normFunc) != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()) {
|
if reflect.ValueOf(normFunc).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() {
|
||||||
t.Error("rootCmd seems to have a wrong normalization function")
|
t.Error("rootCmd seems to have a wrong normalization function")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue