SIGN IN SIGN UP
gin-gonic / gin UNCLAIMED

Gin is a high-performance HTTP web framework written in Go. It provides a Martini-like API but with significantly better performance—up to 40 times faster—thanks to httprouter. Gin is designed for building REST APIs, web applications, and microservices.

0 0 0 Go

test(context): use http.StatusContinue constant instead of magic number 100 (#4542)

* 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)
M
Mehrdad Banikian committed
fb2583442c4d9bccb75e6d26f1aa6e7c01950db6
Parent: 6f1d5fe
Committed by GitHub <[email protected]> on 2/28/2026, 2:13:11 AM