-
Notifications
You must be signed in to change notification settings - Fork 440
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
Proposal: add toDuration #388
Comments
I would like this as well. I am generating files where the output must be milliseconds, but I would like to read and write using timeout: {{ (toDuration "3m").Milliseconds }} renders timeout: 180000 |
## Description This pull request introduce the `toDuration` as proposed in #8 and Masterminds/sprig#388 using the `cast` package. ## Changes - Add the function `toDuration` ## Fixes #8 ## Checklist - [x] I have read the **CONTRIBUTING.md** document. - [x] My code follows the code style of this project. - [x] I have added tests to cover my changes. - [x] All new and existing tests passed. - [ ] I have updated the documentation accordingly. - [x] This change requires a change to the documentation on the website.
Hello everyone 👋, I wanted to let you know that this issue has been addressed in the fork of this project at https://github.com/go-sprout/sprout. The fix has been implemented starting from version For those looking for a solution, I recommend checking out the latest releases of the fork. This should help address the issue discussed in this thread. Thank you! |
I'm using templates to build more complex yaml configuration based on user input without that user input being parsed into go types first. For purpose of calculating with durations I've added this:
Seems this would be a good fit for the type conversion functions.
The text was updated successfully, but these errors were encountered: