Commit 644e428
committed
docs(raftengine): PR783 r2 claude nits — fix stale struct-comment + cleaner errors.Newf wrap
Claude r2 on PR #783 flagged two cosmetic items:
## Issue A (blocking per "before merge") — stale struct comment
The encryptionScanner struct comment said "constructed once per
Engine and embedded into the engine struct" but
Engine.EncryptionScanner() allocates a fresh value on each call
(intentionally — the scanner is stateless). Updated to "wraps the
engine's *MemoryStorage; a fresh value is constructed per
Engine.EncryptionScanner() call (cheap — no internal state)" to
match the implementation.
## Issue B (nit) — awkward errors.Wrapf(errors.New(...))
The no-progress fail-closed path used
errors.Wrapf(errors.New("no progress"), "encryption scanner: ...")
which reads as "encryption scanner: ...: no progress" — making
the sentinel look like the cause rather than just the
description. There's no caller that needs to errors.Is on the
"no progress" sentinel, so collapsing to
errors.WithStack(errors.Newf(...)) is cleaner. Matches the
existing pattern at internal/admin/config.go:109+ for newly-
constructed errors that satisfy wrapcheck.
## Verification
- go test -race -timeout=60s ./internal/raftengine/etcd/... — PASS
- golangci-lint run ./internal/raftengine/etcd/... — 0 issues1 parent cee20b3 commit 644e428
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
0 commit comments