alecthomas / kingpin

CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

values.go:142:25: undefined: str2duration.Str2Duration

xer-rex opened this issue · comments

Hi,

I see the v2.3.0 was out 3 days ago, and my module picked up the new change in values.go. There are problems while building my go script using the kingpin

 [exec] ../vendor/gopkg.in/alecthomas/kingpin.v2/values.go:142:25: undefined: str2duration.Str2Duration

do i understand as the https://github.com/xhit/go-str2duration/blob/master/str2duration.go does not have the Str2Duration function?

If you want this fixed you'll need to send a PR to fix it.

Thx for the reply. I'm sorry, I don't have go lang experience; i'm just maintaining other people's modules in my CI pipeline and learning to troubleshoot the build issue/failure. I will try to see what I can do. Thx for your time.

@xer-rex I use this package as a dependency in another one and faced with the same issue. This might help you go-jose/go-jose#34

Thx @codelav , i use kingpin.v1 at this moment.

Kingpin is correctly using v1 of this package, which does have the Str2Duration function. I don't know why your builds are failing, but I suspect somehow they're not pulling in the correct version.

Hi @alecthomas ,

I tried to create a pull request to use ParseDuration to fix my problem; however, it failed because the go.mod of this project uses go-str2duration v1.2.0 , it has Str2Duration only; therefore, your project does not have any problems. My module takes go-str2duration latest, it has ParseDuration only. Since i don't have go lang experience, i simply used kingpin.v1, which used ParseDuration in values.go, to workaround my compilation issue. :)