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

support time.Duration #967

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open

support time.Duration #967

wants to merge 1 commit into from

Conversation

finchcn
Copy link

@finchcn finchcn commented Sep 19, 2024

Explanation of what this pull request does.

support parse string as time.Duration


Paste benchstat results here

@finchcn
Copy link
Author

finchcn commented Sep 24, 2024

Hi @pelletier , could you please check these changes and give some feedback?

@pelletier
Copy link
Owner

pelletier commented Oct 19, 2024

Hi! Sorry for the delay.

Thank you for the patch! However I don't think duration parsing has it's place in a toml library (unless the TOML spec defines durations as a type). Instead a higher "config" level would be better suited for that. You should be able to achieve the same effect by wrapping time.Duration in a type that implement TextUnmarshaler.

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.

2 participants