Fix stale docs and tighten internal cleanups #patch - #15
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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,
ToChangoroutine blocking risk,Coalesce*early-exit behavior, clearerFinddocs). - Minor internal refactors (avoid shadowing
iter, simplifyMinFuncKV/MaxFuncKVfirst-element handling, remove redundantcmp.Comparecall inCompareKV). - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
iterparameters toseq, simplify MinFuncKV/MaxFuncKV first-element tracking, drop a redundantcmp.Comparecall 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