Skip to content

chore: go fix (Go 1.27 modernizers) - #1167

Merged
batmac merged 1 commit into
mainfrom
go-fix-modernize
Aug 22, 2026
Merged

batmac merged 1 commit into
mainfrom
go-fix-modernize

Conversation

@batmac

@batmac batmac commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Second half of the #1164 cleanup, kept separate so the real fixes in #1166 stayed reviewable. Produced entirely by go fix ./...zero hand-written changes, no behaviour changes.

Despite touching 32 files, the diff is small (+29/-54) and splits cleanly:

17 files — one deleted line each: the obsolete // +build comment kept next to //go:build, only needed for Go < 1.17.

15 files — small modernizations:

change where
continueOnFatal int32 + atomic.Load/Storeatomic.Int32 pkg/log
hand-rolled search loop → slices.Contains pkg/stringutils
if indent < 0 { indent = 0 }max(cfgInt(config), 0) jsonIndent
strings.HasPrefix + manual slicing → strings.CutPrefix sse, wormhole, googleai
for i := 0; i < n; i++for range n assorted

Verified

  • Builds green on all four tag sets: default, libcurl,crappy,keystore, nohl,fileonly, plugins,gcp,aws — this matters here, since the // +build removals touch constraint lines
  • go test ./... passes
  • golangci-lint v2 still reports 0 issues

Reproducible with go fix ./... on a Go 1.27 toolchain.

🤖 Generated with Claude Code

Mechanical rewrite by 'go fix ./...', no behaviour changes:

- 17 files: drop the obsolete '// +build' lines kept alongside
  '//go:build' (only needed for Go < 1.17)
- log: continueOnFatal int32 + atomic.Load/Store -> atomic.Int32
- stringutils: hand-rolled loop -> slices.Contains
- jsonIndent: negative clamp -> max()
- sse, wormhole, googleai: strings.HasPrefix+slicing -> strings.CutPrefix
- assorted 'for i := 0; i < n; i++' -> 'for range n'

Verified: builds green for default, libcurl/crappy/keystore,
nohl/fileonly and plugins/gcp/aws tag sets; go test ./... passes;
golangci-lint v2 still reports 0 issues.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@batmac
batmac enabled auto-merge (squash) August 22, 2026 15:54
@batmac
batmac merged commit 1ebf17e into main Aug 22, 2026
23 of 24 checks passed
@batmac
batmac deleted the go-fix-modernize branch August 22, 2026 15:58
batmac added a commit that referenced this pull request Aug 22, 2026
- rename clipboard_test.go to clipboard_internal_test.go: it needs
  package-internal access, and the repo convention (enforced again now
  that golangci-lint works, see #1166) is _internal_test.go for those
- drop the obsolete '// +build' lines, removed repo-wide in #1167
- name the opener 'cb' instead of 'clipboard', matching its cb://
  scheme like the other openers and the existing cb mutator

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@batmac batmac mentioned this pull request Aug 22, 2026
batmac added a commit that referenced this pull request Aug 22, 2026
* add cb:// opener

* fix(openers): name the clipboard opener cb, follow test conventions

- rename clipboard_test.go to clipboard_internal_test.go: it needs
  package-internal access, and the repo convention (enforced again now
  that golangci-lint works, see #1166) is _internal_test.go for those
- drop the obsolete '// +build' lines, removed repo-wide in #1167
- name the opener 'cb' instead of 'clipboard', matching its cb://
  scheme like the other openers and the existing cb mutator

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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