Skip to content

Parse durations of less than a second #109

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

Merged
merged 8 commits into from
Feb 5, 2025

Conversation

ferpart
Copy link
Contributor

@ferpart ferpart commented Jan 30, 2025

This pr un-comments the functionality to parse durations of less than a second and print them as a second.

@bc-seceng2
Copy link

bc-seceng2 commented Jan 30, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@stuarthicks
Copy link
Contributor

Perhaps it's worth pulling in a library like chrono to handle the ISO-8601 durations for us? All of this code feels like complexity we don't want in this library.

@ferpart
Copy link
Contributor Author

ferpart commented Feb 4, 2025

Perhaps it's worth pulling in a library like chrono to handle the ISO-8601 durations for us? All of this code feels like complexity we don't want in this library.

That was a great suggestion! Updated the code to use the suggested library. The code no uses chrono here: 88e5402

@ferpart ferpart merged commit f656b0e into master Feb 5, 2025
4 checks passed
@ferpart ferpart deleted the bugfix/Less-than-second-parsing branch February 5, 2025 15:20
ferpart added a commit that referenced this pull request Feb 7, 2025
ferpart added a commit that referenced this pull request Feb 10, 2025
* Revert "Parse durations of less than a second (#109)"

This reverts commit f656b0e.

* bugfix: re-use src/time/time.go based parsing

* chore: re-update tests, and add new test cases
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

Successfully merging this pull request may close these issues.

3 participants