Skip to content

Use new duration package with better parsing and to string#74

Merged
ldemailly merged 3 commits intomainfrom
days_duration
Sep 11, 2025
Merged

Use new duration package with better parsing and to string#74
ldemailly merged 3 commits intomainfrom
days_duration

Conversation

@ldemailly
Copy link
Copy Markdown
Member

Fixes #73

@ldemailly ldemailly requested a review from Copilot September 11, 2025 20:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the dflag package to integrate a new duration package that provides enhanced duration parsing and string formatting capabilities. The changes add support for more human-readable duration formats like "3w2d4h" while maintaining backward compatibility.

Key changes:

  • Add fortio.org/duration v1.0.0 dependency for enhanced duration parsing
  • Extend DynValueTypes to support both time.Duration and duration.Duration types
  • Update parsing logic to use the new duration package for better format support

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
go.mod Adds fortio.org/duration v1.0.0 dependency
dyngeneric.go Updates type constraints, parsing logic, and string formatting to support new duration package
dynduration.go Updates copyright notice
dynduration_test.go Adds tests for new duration format support and updates existing tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ldemailly ldemailly merged commit f8be2bb into main Sep 11, 2025
6 checks passed
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.

support for duration with days/weeks

2 participants