Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xer-rex opened this issue Feb 10, 2023 · 6 comments
Open

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

xer-rex opened this issue Feb 10, 2023 · 6 comments

Comments

@xer-rex
Copy link

xer-rex commented Feb 10, 2023

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?

@alecthomas
Copy link
Owner

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

@xer-rex
Copy link
Author

xer-rex commented Feb 10, 2023

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.

@codelav
Copy link

codelav commented Feb 16, 2023

@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

@xer0616
Copy link

xer0616 commented Feb 16, 2023

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

@alecthomas
Copy link
Owner

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.

@xer0616
Copy link

xer0616 commented Feb 16, 2023

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants