Skip to content

Fix stale docs and tighten internal cleanups #patch - #15

Merged
freeformz merged 1 commit into
mainfrom
fix/doc-accuracy-and-internal-cleanup
Jul 3, 2026
Merged

Fix stale docs and tighten internal cleanups #patch#15
freeformz merged 1 commit into
mainfrom
fix/doc-accuracy-and-internal-cleanup

Conversation

@freeformz

Copy link
Copy Markdown
Owner

Summary

  • CLAUDE.md said Go 1.24+; go.mod has required 1.25 since PR Retract v0.3.2 #minor #9 — catch the doc up.
  • CompareFunc/CompareKVFunc docs claimed results are normalized to -1/0/+1; the implementation returns the comparator's raw value — fix the docs to match.
  • ToChan's doc now notes that an abandoned consumer blocks the producer goroutine forever (use ToChanCtx instead).
  • Coalesce/CoalesceKV docs said the sequence is fully iterated before returning; both actually stop at the first non-zero value — fix the docs.
  • Internal cleanup: rename shadowing iter parameters to seq, simplify MinFuncKV/MaxFuncKV first-element tracking, drop a redundant cmp.Compare call in CompareKV, and tighten ExampleWithKV/IterK/IterV from "Unordered output" to "Output" since WithKV iterates a slice in declared order, not a map.

No public API surface added or changed — tagged #patch.

Test plan

  • go build ./...
  • go vet ./...
  • staticcheck ./...
  • go test -v -race ./...

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

CLAUDE.md still said Go 1.24+; go.mod has required 1.25 since PR #9.
CompareFunc/CompareKVFunc docs claimed results were normalized to
-1/0/+1, but the implementation returns the comparator's raw value.
ToChan's doc didn't mention that an abandoned consumer blocks the
producer goroutine forever. Coalesce/CoalesceKV docs said the sequence
is fully iterated before returning, but both stop at the first
non-zero value.

Also rename shadowing `iter` parameters to `seq`, simplify the
MinFuncKV/MaxFuncKV first-element tracking, avoid a redundant
cmp.Compare call in CompareKV, and tighten ExampleWithKV/IterK/IterV
from "Unordered output" to "Output" since WithKV iterates a slice in
declared order, not a map.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 3, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates library and contributor documentation to match actual behavior and requirements, while making a few small internal cleanups in seq.go to improve clarity and avoid redundant work.

Changes:

  • Align docs with implementation details (Go version requirement, comparator return semantics, ToChan goroutine blocking risk, Coalesce* early-exit behavior, clearer Find docs).
  • Minor internal refactors (avoid shadowing iter, simplify MinFuncKV/MaxFuncKV first-element handling, remove redundant cmp.Compare call in CompareKV).
  • Tighten example output annotations to deterministic // Output: where iteration order is defined.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
seq.go Documentation corrections + small internal cleanups (naming, comparison, min/max KV tracking, coalesce/find docs).
seq_test.go Example annotations updated from “Unordered output” to deterministic “Output”.
CLAUDE.md Documentation updated to reflect Go 1.25+ requirement (matching go.mod).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread seq.go
Comment thread seq.go
Comment thread seq.go
@freeformz
freeformz merged commit 44640f5 into main Jul 3, 2026
12 checks passed
@freeformz
freeformz deleted the fix/doc-accuracy-and-internal-cleanup branch July 3, 2026 22:14
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.

2 participants