mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 08:52:25 -05:00
[chore] Update gin to v1.9.0 (#1553)
This commit is contained in:
parent
689a10fe17
commit
ecdc8379fa
347 changed files with 166814 additions and 3671 deletions
16
vendor/github.com/gin-gonic/gin/binding/toml.go
generated
vendored
16
vendor/github.com/gin-gonic/gin/binding/toml.go
generated
vendored
|
|
@ -18,14 +18,6 @@ func (tomlBinding) Name() string {
|
|||
return "toml"
|
||||
}
|
||||
|
||||
func decodeToml(r io.Reader, obj any) error {
|
||||
decoder := toml.NewDecoder(r)
|
||||
if err := decoder.Decode(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
return decoder.Decode(obj)
|
||||
}
|
||||
|
||||
func (tomlBinding) Bind(req *http.Request, obj any) error {
|
||||
return decodeToml(req.Body, obj)
|
||||
}
|
||||
|
|
@ -33,3 +25,11 @@ func (tomlBinding) Bind(req *http.Request, obj any) error {
|
|||
func (tomlBinding) BindBody(body []byte, obj any) error {
|
||||
return decodeToml(bytes.NewReader(body), obj)
|
||||
}
|
||||
|
||||
func decodeToml(r io.Reader, obj any) error {
|
||||
decoder := toml.NewDecoder(r)
|
||||
if err := decoder.Decode(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
return decoder.Decode(obj)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue