Conversation
Neither `go vet` nor staticcheck checks formatting, so nothing in CI did — which is how two files drifted and stayed drifted. Both deviations are struct field alignment and predate this branch (they come from `7b9436e Project restructuration`): a field list in `TestGenerateCA_RespectsOptions` and a literal in `TestValidateServerConfig_PortConflict`. Applied `gofmt -w` to internal/pki/manager_test.go and internal/storage/config_test.go, which is 16 lines and no behaviour change. The step runs before `npm ci`: `gofmt -l` walks the tree, and node_modules has no business being in that walk. On failure it prints the offending files and the diff, so the fix is `gofmt -w` on exactly what it names. One trap worth writing down, because it cost time here: running `gofmt -l` locally on Windows flags extra files that CI reports clean. The working copy is CRLF (core.autocrlf) while gofmt expects LF, so whole files come back as "unformatted". The repository stores LF via .gitattributes, which is what the runner checks out — so trust CI over a local Windows run, or verify with a checkout made with core.autocrlf=false, which is how the two real deviations above were told apart from the four false ones.
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.
Neither
go vetnor staticcheck checks formatting, so nothing in CI did — whichis how two files drifted and stayed drifted.
The two deviations
Both are struct field alignment, and both predate this branch — they come from
7b9436e Project restructuration:internal/pki/manager_test.go— a field list inTestGenerateCA_RespectsOptionsinternal/storage/config_test.go— a literal inTestValidateServerConfig_PortConflictgofmt -won those two: 16 lines, no behaviour change.The step
Added to the
qualityjob, beforenpm ci—gofmt -lwalks the tree, andnode_modules has no business being in that walk. On failure it prints both the
offending files and the diff, so the fix is
gofmt -won exactly what it names.A trap worth knowing about
Running
gofmt -llocally on Windows flags files that CI reports clean. Theworking copy is CRLF (
core.autocrlf) while gofmt expects LF, so entire filescome back as "unformatted".
Locally this listed four files; a checkout made with
core.autocrlf=falselistedtwo — and those two were the real ones. That is how the genuine deviations were
told apart from the artefacts, and it is written into the step's comment so the
next person does not chase the same ghosts.
Verified by replaying the exact step against an LF checkout of this branch: no
files reported.