dongtao9095
dongtao9095
2017-04-21 20:45

添加带有滑行的golang眼镜蛇包装时出错

  • IT行业问题
  • 计算机技术
  • it技术
  • 编程语言问答
  • 互联网问答
已采纳

My glide.yaml import section is

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.Flags().SortFlags undefined (type *pflag.FlagSet has no field or method SortFlags)
vendor/github.com/spf13/cobra/command.go:1240: c.parentsPflags.SortFlags undefined (type *pflag.FlagSet has no field or method 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. any idea what am I doing wrong? thanks in advance!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dsz1966 dsz1966 4年前

    It was problem with glide cache not updating why old version of pflag package was getting installed. More detailed info: https://github.com/spf13/cobra/issues/420

    点赞 评论 复制链接分享

为你推荐