Skip to content

Simplify Buffer: size is plain channel capacity - #96

Merged
destel merged 4 commits into
mainfrom
f/buffer-capacity
Jul 26, 2026
Merged

Simplify Buffer: size is plain channel capacity#96
destel merged 4 commits into
mainfrom
f/buffer-capacity

Conversation

@destel

@destel destel commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Previously, Buffer allocated a channel of capacity size-1 to compensate for the additional item held by the forwarding goroutine. This PR removes that compensation, simplifying the code and making it consistent with the rest of the library, where no stage counts its in-flight item. Since size now means plain channel capacity, zero is a valid value, and Buffer's size validation added in #95 is removed.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.22%. Comparing base (1c3040d) to head (e32b2ec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
- Coverage   99.22%   99.22%   -0.01%     
==========================================
  Files          13       13              
  Lines         649      648       -1     
==========================================
- Hits          644      643       -1     
  Misses          5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@destel
destel merged commit 766b6a3 into main Jul 26, 2026
6 checks passed
@destel
destel deleted the f/buffer-capacity branch July 26, 2026 13:42
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.

1 participant