Skip to content

docs: rewrite README for accuracy and readability - #102

Open
MasterOfBinary wants to merge 1 commit into
masterfrom
docs/readme-rewrite
Open

MasterOfBinary wants to merge 1 commit into
masterfrom
docs/readme-rewrite

Conversation

@MasterOfBinary

Copy link
Copy Markdown
Owner

Summary

Rewrites README.md so it matches the current API and is easier to follow. This is a README-only change.

Errors fixed

  • Helper snippet didn't compile. It declared errs := twice in one scope and called RunBatchAndWait on a Batch that had already been passed to Go. That second call would return ErrBatchUsed. The two approaches are now separate snippets, and each creates its own Batch.
  • Config rules were incomplete. They now say that a MaxItems or MaxTime of 0 means no maximum, and that the min values are lowered only when the max is nonzero.
  • Dynamic config example could produce a mixed config. UpdateBatchSize followed by UpdateTiming take two separate locks, so a batch could start between them. The example now uses Update(ConfigValues{...}).

Existing behavior that is now documented

  • The error channel must be read until it closes. Sends block once the buffer fills, and canceling the context does not unblock them. Don't wait on Done() unless something is already reading the error channel.
  • Done closes slightly before the error channel.
  • Config changes apply from the next batch. The batch currently being collected keeps the values it started with.
  • Batches run concurrently, so a processor can be called concurrently.

Restructure

  • The Contents list now matches the sections.
  • The duplicate "Core Components" and "Key Components" sections are merged into "How It Works".
  • Installation and Quick Start now come first.
  • The stale "Latest Release - v0.5.0" block is replaced by a link to CHANGELOG.md. There are unreleased breaking changes since v0.5.0.
  • Each built-in source and processor now has a short description, including its zero-value behavior.
  • The Quick Start puts all items in a single batch so its documented output is guaranteed.
  • Removed: "Typical Use Cases" (filler) and "Future Roadmap" (one planned feature). Either is easy to restore if you want to keep it.

Verification

  • Every Go snippet in the README was extracted, wrapped where it's a fragment, and passes go vet against the current code.
  • The Quick Start program printed 2 4 6 8 10 in all 200 runs under -race.
  • I checked every factual claim against the source: buffer defaults, the WithBufferConfig panic after Go, normalization rules, field names and defaults of the built-ins, and helper behavior.
  • gofmt -l . is clean, go vet ./... passes, and go test -race ./... passes. golangci-lint wasn't run locally.

Muse Code drafted the rewrite. Claude Code reviewed it, verified it and tightened the Configuration section.

🤖 Generated with Claude Code

https://claude.ai/code/session_012mrmR4Bfwbgy98KvB7WzKG

Fix README errors found in review:
- The helper-function snippet redeclared errs and reused a single-use
  Batch, so it did not compile and would have returned ErrBatchUsed.
- The config rules did not say that a MaxItems or MaxTime of 0 means
  no maximum.
- The DynamicConfig example used two separate updates, so a batch could
  start between them; it now uses Update.

Document existing behavior that was missing:
- The error channel must be read until it closes; sends block once the
  buffer fills, and canceling the context does not unblock them.
- Done closes slightly before the error channel.
- Config changes apply from the next batch.
- Batches run concurrently, so processors may be called concurrently.

Restructure for readability: fix the Contents list, merge the duplicate
component sections, put install and a quick start first, replace the
stale v0.5.0 release notes with a link to CHANGELOG.md, and describe each
built-in source and processor. The Quick Start now uses a single batch so
its output order is guaranteed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mrmR4Bfwbgy98KvB7WzKG
@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.76%. Comparing base (63ef757) to head (c6cfd24).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #102   +/-   ##
=======================================
  Coverage   96.76%   96.76%           
=======================================
  Files          12       12           
  Lines         371      371           
=======================================
  Hits          359      359           
  Misses          9        9           
  Partials        3        3           

☔ 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.

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