* feat: add support for the HTTP QUERY method (RFC 10008)
Add a QUERY shortcut on RouterGroup, a gin.MethodQuery constant and a
gin.IQueryRoutes interface for callers that only hold an IRoutes value.
QUERY is deliberately kept out of IRoutes and out of Any:
- Adding a method to IRoutes would break every type outside of Gin that
implements it, such as test doubles and wrappers.
- Leaving Any untouched keeps existing catch-all routes matching exactly
the methods they matched before. Match([]string{gin.MethodQuery, ...})
covers the case where QUERY is wanted alongside other methods.
MethodQuery is declared in Gin because the standard library does not
provide http.MethodQuery yet. The value stays correct once it does.
Ref #4721
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(router): remove duplicate QUERY method
- Consolidate QUERY into the existing router method after merging master
- Preserve the MethodQuery constant and request body documentation
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* test(ginS): add comprehensive test coverage for ginS package
Improve test coverage for ginS package by adding 18 test functions covering HTTP methods, routing, middleware, static files, and templates.
* use http.Method* constants instead of raw strings in gins_test.go
* copyright updated in gins_test.go
---------
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* ci: update golangci-lint configuration and lint settings
- Update golangci-lint to version 2
- Enable new linters and adjust existing ones
- Update lint settings across multiple test files
- Remove unused struct and variable checks
- Add new lint exclusions for generated code and specific directories
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* ci(github): update golangci-lint-action to v8 and lint version to v2.3.4
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* ci: downgrade golangci-lint to v2.1.6
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* ci(golangci): add gofumpt linter and fix related issues- Added gofumpt linter to .golangci.yml
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* test: ignore testifylint and gofumpt lints in specific test cases
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* build(deps): remove golang.org/x/lint
- Remove golang.org/x/lint package from go.mod
- Update related dependencies in go.sum
Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>
* build(deps): downgrade golang.org/x/mod and golang.org/x/tools
- Downgrade golang.org/x/mod from v0.24.0 to v0.18.0
- Downgrade golang.org/x/tools from v0.33.0 to v.22.0
These changes are made to address compatibility issues with the current project setup.
Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>
---------
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
Signed-off-by: flc1125 <four_leaf_clover@foxmail.com>