8000 Check the reachable time.Tick receive branch by dajiaohuang · Pull Request #1809 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Check the reachable time.Tick receive branch - #1809

Open
dajiaohuang wants to merge 2 commits into
dominikh:masterfrom
dajiaohuang:fix/sa1015-time-tick-branch
Open

dajiaohuang wants to merge 2 commits into
dominikh:masterfrom
dajiaohuang:fix/sa1015-time-tick-branch

Conversation

@dajiaohuang
@dajiaoh
8000
uang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

Terminates recognizes the reachable receive branch of time.Tick: the channel does not close, so an explicit return on ok=true can terminate, whereas a return only on ok=false is unreachable. Handle the optional negation of the receive status before selecting the reachable branch.

The new regression cases use a positive tick interval, since time.Tick(0) returns a nil channel and cannot exercise a live receive branch. Legacy fixture cases are preserved.

Validation after fixture correction: go test ./staticcheck/sa1015 ./go/ir/irutil passed (nine tests); gofmt and git diff --check passed.

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

0