Clear the linter, and fix the three things it found - #4
Merged
Merged
Conversation
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.
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.
CI has been red on lint since the rewrite landed. Nineteen issues, three of them real.
Pagesaid it escaped every path segment and copied them across untouched, which works until the first branch with a space in its name.GetJSONhanded 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, andnoJSONHerewas written for exactly that and never wired up.github archive -owrote 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.gowas 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 isprovenance.gonow. Then a De Morgan, two append loops, a tagged switch, an ineffectual assignment, and a comment still callingrailsNextby its old name.Testing
golangci-lint runreports 0 issues.go build,go vet, andgo test ./...are clean, the live suite passes, andgithub archive -owas run against a real repository and the tarball unpacked.