Commit 91814fe
chore: resolve SA5011 staticcheck warnings in test files (#364)
Replace `if x == nil { t.Fatal(...) }` guard pattern with
`require.NotNil(t, x, ...)`. The old pattern confuses newer staticcheck
(Go 1.26+) which doesn't track `testing.T.Fatal` as noreturn in all
cases, flagging subsequent dereferences as possible nil dereferences.
Files already import testify/require so this is a minimal mechanical
change with no behavior difference — `require.NotNil` calls
`t.FailNow()` under the hood.
Affected:
- differ/differ_test.go (1 site)
- validator/refs_test.go (1 site)
- validator/validator_test.go (3 sites)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent a6e2307 commit 91814fe
3 files changed
Lines changed: 5 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
| 284 | + | |
287 | 285 | | |
288 | 286 | | |
289 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
374 | 372 | | |
375 | 373 | | |
376 | 374 | | |
377 | | - | |
378 | | - | |
379 | | - | |
| 375 | + | |
380 | 376 | | |
381 | 377 | | |
382 | 378 | | |
| |||
394 | 390 | | |
395 | 391 | | |
396 | 392 | | |
397 | | - | |
398 | | - | |
399 | | - | |
| 393 | + | |
400 | 394 | | |
401 | 395 | | |
402 | 396 | | |
| |||
0 commit comments