[英]error adding golang cobra package with glide
My glide.yaml import section is 我的glide.yaml导入部分是
import:
- package: github.com/spf13/cobra
I have 我有
import (
"github.com/spf13/cobra"
)
in my code. 在我的代码中。
but I am getting the error 但我得到了错误
vendor/github.com/spf13/cobra/command.go:1092: c.lflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
vendor / github.com / spf13 / cobra / command.go:1092:c.lflags.SortFlags未定义(类型* pflag.FlagSet没有字段或方法SortFlags)
vendor/github.com/spf13/cobra/command.go:1092: c.Flags().SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)vendor / github.com / spf13 / cobra / command.go:1092:c.Flags()。SortFlags未定义(类型* pflag.FlagSet没有字段或方法SortFlags)
vendor/github.com/spf13/cobra/command.go:1240: c.parentsPflags.SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)vendor / github.com / spf13 / cobra / command.go:1240:c.parentsPflags.SortFlags未定义(类型* pflag.FlagSet没有字段或方法SortFlags)
couples of issues on cobra repo says that can happen if pflag package is old version but in my case don't have that package installed separately. 关于眼镜蛇回购的几个问题说,如果pflag软件包是旧版本,可能会发生,但在我的情况下,不要单独安装该软件包。 any idea what am I doing wrong?
知道我在做什么错吗? thanks in advance!
提前致谢!
It was problem with glide cache not updating why old version of pflag package was getting installed. 这是滑行缓存不更新为什么安装旧版本的pflag软件包的问题。 More detailed info: https://github.com/spf13/cobra/issues/420
更详细的信息: https : //github.com/spf13/cobra/issues/420
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.