Commit 602899a
authored
chore: Go 1.27 toolchain, lint fixes, go fix modernization (#800)
## Description
Full Go 1.27 update in four commits:
1. **Toolchain go1.26.6 → go1.27.0** — CI resolves its Go version from
`go.mod` via the shared `netresearch/.github` go-check workflow. Also
bumps the two Makefile `GOTOOLCHAIN` pins for the golangci-lint install,
and corrects the prerequisite in `docs/DEVELOPMENT.md` and
`CONTRIBUTING.md` from "Go 1.25+" to "Go 1.26+" (the `go` directive has
required 1.26 already).
2. **Lint fixes under the 1.27 toolchain** — gofumpt's new closing-paren
placement in one test file, and removal of six `//nolint:goconst`
directives that nolintlint now reports as unused (goconst no longer
fires there; all annotated literals sit below the config's
`min-occurrences: 6`, and `.golangci.yml` is untouched by this PR).
3. **`go fix` modernization** across 14 files — `strings.Cut` (2 sites),
`slices.Backward` (RemoveJobsByTag), `maps.Copy`, `errors.AsType[T]` (3
sites), `atomic.Int32` migrations in six test files, and inlining of the
`durationPtr`/`uint64Ptr` test helpers to `new(expr)` with the
now-unused helpers removed.
4. **Review-round comment fix** — the `slices.Backward` removal in
RemoveJobsByTag is safe because of the `break` after the removal (the
range form captures the slice header once); the comment now says so
instead of describing the old index loop.
The `go` directive stays at 1.26.
## Testing
`go build ./...`, `go vet ./...`, `golangci-lint run` (0 issues) and `go
test -race ./...` (14 packages, all pass) under go1.27.0; `go mod tidy`
is a no-op. An independent review agent proved the `slices.Backward`
rewrite equivalent for all inputs (including duplicate cron IDs),
verified the goconst occurrence counts against the config, and found no
weakened assertions.
The advisory SonarCloud check is red on new-code duplication (5.3% vs
3%) — the mechanical `atomic.Int32` test rewrites count as "new code";
not in the required-checks ruleset.
_Assisted by claude-code:claude-fable-5 —
[Session](https://claude.ai/code/session_01L7tF9XuJfAfFk4yuY5KfPK)_24 files changed
Lines changed: 86 additions & 92 deletions
File tree
- cli
- config
- core
- adapters/docker
- docs
- middlewares
- test/testutil
- web
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
0 commit comments