Repository navigation
Conversation
Five checks, composing as universal to go to web to go.gin. The critical one is recovery. An unrecovered panic in a handler ends the process rather than the request, so one malformed input is an outage for every connected client. The convenience constructor includes recovery and the manual one does not, which is exactly the kind of difference that survives review. Next to it, the convenience run method starts a server with no timeouts at all, so a slow client holds a goroutine and a descriptor for as long as it likes. Then release mode rather than the debug default, which otherwise prints the whole route table into the logs, trusted proxies named rather than every client believed about its own address, and a bound on multipart uploads. Each command was run against a project that gets all five wrong and against one that gets them right, so both the finding and the clean result were confirmed rather than assumed. Three references pointed into the examples section of the Gin site, which no longer exists and returned 404. They now point at pages that resolve, with the timeout and upload references going to the standard library documentation where the behaviour actually lives. gin-gonic.com and pkg.go.dev added to the reference allowlist.
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.
Tier 1, item 5 — the last one.
universal → go → web → go.gin, 5 new checks.recovery-middleware-presentgin.Default()includes recovery,gin.New()does not, and that difference survives review easilyserver-timeouts-set.Run()starts a server with no timeouts at all; a slow client holds a goroutine and a descriptor indefinitelyrelease-modetrusted-proxies-restrictedupload-size-boundedVerification, both directions
Each command was run against a project that gets all five wrong (
gin.New(),bare
.Run(":8080"), no mode, no proxies, no limit) and against one that getsthem right. Both the finding and the clean result were confirmed — a check
that cannot distinguish the two is worse than nothing.
Three dead references, caught by the link check
/en/docs/examples/*no longer exists on the Gin site — all three returned 404.That whole section is gone, not just moved:
Repointed at pages that resolve, with the timeout and upload references going to
the standard library docs, where the behaviour actually lives —
net/httpownstimeouts and
MaxBytesReader, not Gin. Arguably the better citation anyway.gin-gonic.comandpkg.go.devadded to the allowlist;--check-linkspasses.