Repository navigation
refactor: clear the gopls and go fix findings in cmd, herdrplugin and fang - #1539
Merged
Merged
Conversation
Contributor
Binary size
The ceiling is 47000000 bytes for each target. Main's size is from main at c606b6b (https://github.com/Gaurav-Gosain/tuios/actions/runs/41818148802). State the size cost in the pull request body. CI fails only above the ceiling. |
go fix suggested it. PathComponent returns the same string.
The //go:build line above it is the one the toolchain reads since Go 1.17. go fix removes the old form on windows.
go fix suggested it for js/wasm. failure fills the same fields.
gopls flagged the string concatenation inside WriteString. Fprintf writes the parts into the builder without the temporary string, and View is 160 bytes smaller. Five WriteString calls would have made it 790 bytes larger.
Gaurav-Gosain
force-pushed
the
refactor/cmd-herdrplugin-fang-findings
branch
from
November 4, 2026 11:21
9b018b5 to
2e45da3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gopls and go fix findings in cmd/ and the smaller internal packages, outside app and session. One commit per package. The linux text section is 192 bytes smaller.
Scope
WriteStringinlookPicker.View. Onefmt.Fprintfwrites the row now.Viewis 160 bytes smaller. Five separateWriteStringcalls, the form gopls suggests, made it 790 bytes larger, so I did not use them.failurematches*sketch.Errorwitherrors.AsType. go fix reports it only for js/wasm.PathComponenttrims the trailing dot withstrings.CutSuffix. It returns the same string.fang_windows.godrops its// +build windowsline. The//go:buildline above it is the one the toolchain reads. go fix reports it only for windows.How I found them
go fix -diff ./...for linux, windows, darwin, freebsd, js/wasm (with the modfile the wasm build uses) and-tags ghostty, andgopls checkon every Go file in cmd/ and internal/ outside app and session. This pull request takes every finding in those packages except the ones in #1538 and two I left out on purpose, which #1538 explains.Verification
just check --changedpasses,fixincluded.go testpasses for cmd/tuios and internal/herdrplugin.go vetpasses for cmd/sketch-wasm with GOOS=js and for internal/fang with GOOS=windows.