Skip to content

Clear the linter, and fix the three things it found - #4

Merged
tamnd merged 1 commit into
mainfrom
lint-clean
Jul 25, 2026
Merged

Clear the linter, and fix the three things it found#4
tamnd merged 1 commit into
mainfrom
lint-clean

Conversation

@tamnd

@tamnd tamnd commented Jul 25, 2026

Copy link
Copy Markdown
Owner

CI has been red on lint since the rewrite landed. Nineteen issues, three of them real.

Page said it escaped every path segment and copied them across untouched, which works until the first branch with a space in its name.

GetJSON handed a 406 or a 410 to the JSON decoder and reported whatever the decoder made of the HTML it got. Both statuses are routing answers, and noJSONHere was written for exactly that and never wired up.

github archive -o wrote to a file with a deferred close whose error went nowhere, and a close is where the last of a write gets flushed.

The rest is dead code and style. Two thirds of merge.go was a reflective field-level merge that nothing calls, because records are assembled by decoding several blocks of one page into one struct. What is left is the three provenance helpers that are used, so the file is provenance.go now. Then a De Morgan, two append loops, a tagged switch, an ineffectual assignment, and a comment still calling railsNext by its old name.

Testing

golangci-lint run reports 0 issues. go build, go vet, and go test ./... are clean, the live suite passes, and github archive -o was run against a real repository and the tarball unpacked.

CI has been red on lint since the rewrite landed. Nineteen issues, and
three of them were real.

Page said it escaped every path segment and copied them across untouched.
That works until the first branch with a space in its name. It escapes
now.

GetJSON handed a 406 or a 410 to the JSON decoder and reported whatever
the decoder made of the HTML it got. Both statuses are routing answers,
so it says which road instead: noJSONHere, which had been written for
exactly this and never wired up.

github archive -o wrote to a file with a deferred close whose error went
nowhere, and a close is where the last of a write gets flushed. It closes
by hand and returns the error.

The rest is dead code and style. Two thirds of merge.go was a reflective
field-level merge that nothing calls: records are assembled by decoding
several blocks of one page into one struct, so there is nothing to merge.
What is left is the three provenance helpers that are used, and the file
is called provenance.go now because that is what it does. timeoutFor went
with it, since the byte-plane commands it named do get a context. Then a
De Morgan, two append loops, a tagged switch, an ineffectual assignment,
and a comment that still called railsNext by its old name.
@tamnd
tamnd merged commit 26a4fb5 into main Jul 25, 2026
6 of 7 checks passed
@tamnd
tamnd deleted the lint-clean branch July 25, 2026 14:44
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