Add two regression tests for GitHub issue #1848 to verify that
Context.handlers are properly isolated in HandleContext when used
from a NoRoute handler with group and engine middleware.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove 20 deprecated frameworks from benchmark report
- Add BunRouter and Fiber as newly benchmarked routers
- Add ranked summary table based on GitHub API throughput
- Add memory consumption tables sorted by bytes ascending
- Include all micro and API benchmark results with rankings
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AUTHORS.md was a manually maintained list of 400+ contributors that
had no automation to keep it current. Replace it with a link to
GitHub s built-in contributors page which is always up-to-date.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update test environment to Apple M4 Pro, Go 1.25.8, macOS
- Add table of contents for easier navigation
- Add ranked summary tables for each API benchmark
- Reorganize full results by API section with clear headings
- Refresh all memory consumption and benchmark data
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Bump golangci-lint from v2.9 to v2.11
- Bump aquasecurity/trivy-action from 0.34.2 to 0.35.0
- Upgrade golang.org/x packages (net, crypto, sys, text, arch)
- Upgrade go-json, mimetype, and protobuf to latest patch versions
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The flat TOC under a single "API Examples" heading made it hard to scan
and find relevant content. Reorganize 40+ sections into 7 logical groups
(Routing, Middleware, Logging, Request Binding & Validation, Response
Rendering, Server Configuration, Testing) with description lines for
each group. Move scattered sections into their correct groups and fix
the "avoid-loging-query-strings" anchor typo.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* render: add PDF renderer and tests
* render: update PDF renderer copyright header
* test: add PDF rendering tests including 204 No Content in context_test.go
- Update release announcement section to introduce Gin 1.12.0
- Provide a more detailed description of new features and improvements in version 1.12.0
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* ci: update Go version support to 1.25+ across CI and docs
- Remove Go 1.24 from CI test matrix to only support 1.25 and 1.26
- Update documentation to require Go version 1.25 or above
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* chore: increase required Go version for Gin to 1.25
- Update minimum required Go version for Gin from 1.24 to 1.25
- Revise related warning message and test expectations to match new version requirement
Signed-off-by: appleboy <appleboy.tw@gmail.com>
---------
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* fix(tree): panic in findCaseInsensitivePathRec with RedirectFixedPath enabled
When RedirectFixedPath is enabled and a request doesn't match any route,
findCaseInsensitivePathRec panics with "invalid node type". This happens
because it accesses children[0] to find the wildcard child, but addChild()
keeps the wildcard child at the end of the array (not the beginning).
When a node has both static and wildcard children, children[0] is a static
node, so the switch on nType falls through to the default panic case.
The fix mirrors what getValue() already does correctly (line 483):
use children[len(children)-1] to access the wildcard child.
Fixes#2959
* Address review feedback: improve test assertions and prefer static routes in case-insensitive lookup
- Assert found=false for non-matching paths instead of only checking for panics
- Fix expected casing for case-insensitive static route match (/PREFIX/XXX -> /prefix/xxx)
- Update findCaseInsensitivePathRec to try static children before falling back to
wildcard child, ensuring static routes win over param routes in case-insensitive matching
---------
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* refactor(context): use http.StatusContinue constant instead of magic number 100
Replace magic number 100 with http.StatusContinue constant for better
code clarity and maintainability in bodyAllowedForStatus function.
Also fix typo in logger_test.go: colorForLantency -> colorForLatency
Fixes#4489
* test: improve coverage to meet 99% threshold
- Add TestContextGetRawDataNilBody to cover nil body error case
- Add SameSiteDefaultMode test case in SetCookieData
- Add 400ms latency test case for LatencyColor
- Add TestMarshalXMLforHSuccess for successful XML marshaling
Coverage improved from 99.1% to 99.2%
* fix: use require for error assertions (testifylint)
* test(render): add comprehensive error handling tests
Add error case tests for XML, Data, BSON, and HTML renderers to improve test coverage and ensure proper error handling:
- TestRenderXMLError: validates XML marshal error handling for unsupported types
- TestRenderDataError: validates Data write error handling
- TestRenderBSONError: validates BSON marshal error handling for unsupported types
- TestRenderBSONWriteError: validates BSON write error handling
- TestRenderHTMLTemplateError: validates HTML template execution error with invalid field access
- TestRenderHTMLTemplateExecuteError: validates HTML template execution error with invalid nested field
All tests pass and maintain 100% coverage for the render package.
* test(render): improve robustness of error handling tests based on PR feedback
---------
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: AmirHossein Fallah <amirhossein.fallah@arvancloud.ir>
This is useful for APIs that might have sensitive information in the query string, such as API keys.
This patch does not change the default behavior of the code unless the new `SkipQueryString` config option is passed in.
The "skip" term is a bit of a misnomer here, as this doesn't actually skip that log, but modifies the output. I'm open to suggestions for a more appropriate name.
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update gin workflow to use v2.9 and add Go 1.26 to the matrix
- Upgrade Trivy action to v0.34.0 in the scan workflow
- Change all single quotes to double quotes in Trivy workflow configuration
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* test(render): add comprehensive tests for MsgPack render
* test(render): make msgpack tests deterministic
Decode the rendered msgpack output and assert values instead of comparing raw bytes (which can vary with map iteration order).
Enable MsgpackHandle.RawToString so msgpack strings decode as Go strings.
---------
Co-authored-by: AmirHossein Fallah <amirhossein.fallah@arvancloud.ir>
Use http.StatusContinue and http.StatusOK instead of hardcoded 100 and
199 for the 1xx informational status range check, consistent with the
pattern already used in logger.go.
Fixes#4489
* fix: correct typos and improve documentation clarity
- Fix typo "Oupps" to "Oops" in recovery test panic messages
- Fix confusing documentation in Bind() and ShouldBind() methods
that incorrectly stated "JSON or XML as a JSON input"
- Remove double period in StaticFileFS documentation comment
- Remove unused ErrorTypeNu constant that had duplicate comment
with ErrorTypeAny and was never used in the codebase
* tech: Fix the pull request routing link