charmbracelet / charmbracelet/bubbles

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

Open
#862 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
8.9k
Forks
457
Avg merge
1d 18h
Merged PRs (30d)
5

Description

**Describe the bug**
In v2, creating a stopwatch with `stopwatch.New()` (and no `stopwatch.WithInterval` argument) creates a stopwatch with an interval of 0, which causes some problems as the elapsed time never increases.

**Source Code**
https://github.com/charmbracelet/bubbles/blob/84a82dfeeed8089e0b9fd23a6344930b4f75eaf7/stopwatch/stopwatch.go#L65-L75

**Expected behavior**
According to the documentation, the interval should default to 1 second.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.