mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
refactor: improve binding, performance, and type safety
- Implement ShouldBind with support for JSON, Form, WANF, and GOB formats
- Add ShouldBindForm, ShouldBindGOB, and helper functions for form binding
- Use fmt.Appendf instead of fmt.Sprintf for better performance
- Replace interface{} with any for modern Go style
- Use maps.Copy for cleaner header copying
- Update strings.SplitSeq to use range over strings.Seq
- Remove deprecated placeholder comments and add proper implementations
- Fix reflect.Pointer usage for Go 1.22+ compatibility
This commit is contained in:
parent
9e3e43bf88
commit
c4c0160b5f
6 changed files with 187 additions and 36 deletions
2
touka.go
2
touka.go
|
|
@ -12,7 +12,7 @@ const (
|
|||
defaultMemory = 32 << 20 // 32 MB, Gin 的默认值,用于 ParseMultipartForm
|
||||
)
|
||||
|
||||
type H map[string]interface{} // map简写, 类似gin.H
|
||||
type H map[string]any // map简写, 类似gin.H
|
||||
|
||||
type Handle func(http.ResponseWriter, *http.Request, Params)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue