Merged
Conversation
Collaborator
Leeaandrob
approved these changes
Feb 17, 2026
Collaborator
Leeaandrob
left a comment
There was a problem hiding this comment.
PR #227 Deep Review — @mattn
Clean, correct fix. The running bool field in MaixCamChannel shadowed the embedded BaseChannel.running, causing c.running (direct field access at line 73) to always read false while c.setRunning(true) set the base field.
Verification
- Checked out branch locally:
fix-shadowing-running go vet ./pkg/channels/...— cleango test ./pkg/channels/...— all 15 tests passing- Audited all 12 channel struct definitions — no other channel has this shadowing issue
- Confirmed
c.runningat maixcam.go:73 now correctly resolves toBaseChannel.runningthrough Go embedding promotion
Impact Analysis
Before fix:
c.setRunning(true)→ setsBaseChannel.running = truec.IsRunning()→ readsBaseChannel.running→true(correct)c.running(line 73) → readsMaixCamChannel.running→ alwaysfalse(shadowed!)
Effect: Connection accept errors were silently swallowed — the error log at line 73-77 never fired because the shadowed field was always false.
After fix: c.running correctly resolves to BaseChannel.running — error logging works.
Summary of Findings
LOW (Optional)
- L1:
c.runningat line 73 is the only direct field access across all 12 channels — all others usec.IsRunning(). Consider usingc.IsRunning()for consistency (minor, not blocking).
POSITIVE
- Correctly identifies and fixes Go struct embedding shadowing bug
- Minimal 2-line change with zero risk of regression
- No other channels are affected — confirmed by codebase audit
Verdict: APPROVE
Clean fix, zero risk. Ready to merge.
SebastianBoehler
pushed a commit
to SebastianBoehler/picoclaw
that referenced
this pull request
Feb 22, 2026
Fix shadowing field runnnig
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.
runningfield is shadowing in BaseChannel.running. So running field always be false.