Repository navigation
Fix FindReaderIndex channel handling, doc example, filename typos; Go 1.24 - #2
Closed
vertoforce wants to merge 1 commit into
Closed
vertoforce wants to merge 1 commit into
vertoforce wants to merge 1 commit into
Conversation
…dernize to Go 1.24
- Close the index channel when the scanner goroutine finishes so
'for range' over it terminates instead of hanging forever; document
that callers must drain both channels to avoid deadlocking the
split function.
- Fix ExampleFindReaderIndex's // Output: comment — the example prints
both match and index ("stream of [20 32]"), so go test failed.
- Rename steamregexindex(.go|_test.go) -> streamregexindex(.go|_test.go).
- Bump go.mod go directive to 1.24; gofmt/go vet clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vertoforce
force-pushed
the
cleanup-2026-07
branch
from
July 15, 2026 05:13
159f458 to
3721c57
Compare
Owner
Author
|
Superseded by #3, which includes these same fixes plus the caller-owned-channel + error-returning API redesign. Closing to avoid a conflicting double-merge. |
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
FindReaderIndexfixes (streamregexindex.go): the index channel was never closed, sofor rangeover it hung forever. It is now closed when the scanner goroutine finishes, and the doc comment documents that callers must drain both channels (each match sends its index before the match itself, so ignoring the index channel deadlocks the split function).ExampleFindReaderIndexprints both match and index, but its// Output:comment only listed the match, sogo testfailed. Corrected tostream of [20 32].steamregexindex.go/steamregexindex_test.gorenamed tostreamregexindex.go/streamregexindex_test.goviagit mv.go.modgo directive bumped to 1.24;go mod tidy,gofmt,go vet ./...clean.Test results
Also verified with a temporary regression test that
for rangeover the index channel now terminates (previously hung).🤖 Generated with Claude Code