Skip to content

fix: clear the unused findings golangci-lint reports on windows and freebsd - #1537

Merged
Gaurav-Gosain merged 3 commits into
mainfrom
fix/unused-on-windows-and-freebsd
Nov 4, 2026
Merged

Gaurav-Gosain merged 3 commits into
mainfrom
fix/unused-on-windows-and-freebsd

Conversation

@Gaurav-Gosain

Copy link
Copy Markdown
Owner

golangci-lint reports four unused declarations outside internal/app and internal/session when it loads the tree for windows or freebsd. CI lints only linux, so they stayed. Each one serves only some platforms, so I moved it into a file built for those platforms. No code changes.

Scope

One commit per package:

  • federation: masterNameLen and reuseArgs move from reuse.go to reuse_unix.go (!windows), beside their one caller. On windows they were unused.
  • herdrplugin: commandEnv moves from reaper.go to reaper_unix.go. RunReaper on unix is its only caller.
  • transcriptview: myUID moves from owner_unix.go to a new opencode_conn_uid.go built for linux and darwin. Only the linux and darwin connection checks read it, and so does opencode_conn_unix_test.go, which has the same tag. On freebsd it was unused.

Verification

  • golangci-lint run v2.14.0 on the three packages, with GOOS set to linux, windows, darwin and freebsd: 0 issues on each. On main, windows reports the federation and herdrplugin findings and freebsd reports myUID.
  • go vet of the three packages for linux, windows, darwin and freebsd passes.
  • just check --changed passes. Its fix report names herdrplugin/discover.go:126, an older line this branch does not change.
  • go test passes for federation, herdrplugin and transcriptview.
  • Binary size with the release flags, against main at 57150e1: linux/amd64 46,919,840 bytes before and after, darwin/arm64 43,707,106 before and after.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Binary size

target this change main change room under the ceiling
darwin/arm64 43724354 bytes 43724354 bytes +0 bytes (+0.0 KiB) 3275646 bytes
linux/amd64 46944416 bytes 46944416 bytes +0 bytes (+0.0 KiB) 55584 bytes

The ceiling is 47000000 bytes for each target. Main's size is from main at 578794b (https://github.com/Gaurav-Gosain/tuios/actions/runs/41816798389).

State the size cost in the pull request body. CI fails only above the ceiling.

masterNameLen and reuseArgs serve only the !windows build, so
golangci-lint reported both as unused for GOOS=windows. They move beside
their one caller. CI lints linux only, which is why the finding stayed.
RunReaper on unix is its only caller, so golangci-lint reported it as
unused for GOOS=windows.
Only the linux and darwin connection checks call myUID, so
golangci-lint reported it as unused for GOOS=freebsd. It moves to a file
built for those two.
@Gaurav-Gosain
Gaurav-Gosain force-pushed the fix/unused-on-windows-and-freebsd branch from 0f7a3dc to c606b6b Compare November 4, 2026 10:50
@Gaurav-Gosain
Gaurav-Gosain merged commit c606b6b into main Nov 4, 2026
27 checks passed
@Gaurav-Gosain
Gaurav-Gosain deleted the fix/unused-on-windows-and-freebsd branch November 4, 2026 11:02
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