refactor(progress): extract bar styling into styleBar function + add tests #153
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget!153
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/progress-bar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Extract duplicated bar styling into a
styleBar()helper function. Add custom colored bar characters using konsoru color/style. GuardDone()against double-close. Add package doc comment and unit tests for the progress Tracker.Why
New()andSetTotal()Done()is called multiple timesTesting
go test ./internal/progress/...— 8 tests, all passgo vet ./...— passesgo build ./...— passesBreaking Changes
None
Notes
━) on dark background for visual polishDone()now usesselectguard to prevent panic on double-closeDone()updatescurrenttototalfor consistent staterefactor: extract bar styling into separate functionto refactor(progress): extract bar styling into styleBar function + add testsReview: APPROVED
Changes
internal/progress/progress.go— ExtractedstyleBar()removing 10 lines of duplication; added konsoru color/style imports for cyan bar chars; guardedDone()against double-close; updatedcurrenttototalon completion; added package doc commentinternal/progress/progress_test.go(new) — 8 unit tests covering New, Add, SetTotal, Done lifecycle, and double-close safetyVerification
go vet ./...— ✅go build ./...— ✅go test ./...— ✅ all passKey points
styleBar()consolidates bar config in one placeDone()is safe viaselectguard