Skip to content

fix(stopwatch): initialize Interval field with default 1s#903

Open
JesterSe7en wants to merge 1 commit intocharmbracelet:mainfrom
JesterSe7en:fix/stopwatch-default-interval-862
Open

fix(stopwatch): initialize Interval field with default 1s#903
JesterSe7en wants to merge 1 commit intocharmbracelet:mainfrom
JesterSe7en:fix/stopwatch-default-interval-862

Conversation

@JesterSe7en
Copy link
Copy Markdown

Fixes #862

Description:
The New() function was documented to default to a 1s interval, but it was initializing with a 0 duration

Changes:

Initialized Interval to time.Second in the New function.

Took the liberty to create stopwatch_test.go to verify the default value and ensure WithInterval still works correctly.

This is my first-ever contribution to open source! So please let me know if there are any style adjustments or changes you'd like me to make.

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

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.

v2: Stopwatch doesn't default to 1 second as documented

1 participant