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

BUG: viper.GetDuration() doesn't work as expected #203

Closed
chyeh opened this issue Jun 21, 2016 · 2 comments
Closed

BUG: viper.GetDuration() doesn't work as expected #203

chyeh opened this issue Jun 21, 2016 · 2 comments

Comments

@chyeh
Copy link

chyeh commented Jun 21, 2016

Take a look at this for bug reproduction:
https://gist.github.com/chyeh/450810068c7ab180b2a1f9e97c4c636c

Some of the config types work when the units of the durations are not specified, some get zero value.

I found that it should be the problem from #47, can I fix it (actually I kind of did lol) and send a PR? Do you have something like contributor's guide that I should follow?

@chyeh
Copy link
Author

chyeh commented Jun 21, 2016

The bug should be at ToDurationE() in caste.go of the package cast. I will send a PR to cast later

chyeh added a commit to chyeh/cast that referenced this issue Jun 21, 2016
It used to return zero valeus in some cases. The details are described
in [this issue](spf13/viper#203). More cases
were also added in the unit test `TestToDuration()`
chyeh added a commit to chyeh/nqm-sampling-frame that referenced this issue Jun 21, 2016
Currently I use `chyeh/viper` as a workaround for a bug in
`GetDuration()`. The details of the bug are described in
[this issue](spf13/viper#203).
bep pushed a commit to spf13/cast that referenced this issue Sep 19, 2016
It used to return zero valeus in some cases. The details are described
in [this issue](spf13/viper#203). More cases
were also added in the unit test `TestToDuration()`
@chyeh
Copy link
Author

chyeh commented Sep 23, 2016

PR merged, tks

@chyeh chyeh closed this as completed Sep 23, 2016
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

1 participant