summaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-gonic/gin/binding/toml.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-02-25 13:12:40 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-25 12:12:40 +0000
commitecdc8379fa8f9d88faca626e7de748c2afbe4910 (patch)
tree8c20a5826db2136fc89bee45e15355c5899fa65b /vendor/github.com/gin-gonic/gin/binding/toml.go
parent[bugfix] Fix deleted status causing issues when getting bookmark (#1551) (diff)
downloadgotosocial-ecdc8379fa8f9d88faca626e7de748c2afbe4910.tar.xz
[chore] Update gin to v1.9.0 (#1553)
Diffstat (limited to 'vendor/github.com/gin-gonic/gin/binding/toml.go')
-rw-r--r--vendor/github.com/gin-gonic/gin/binding/toml.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/github.com/gin-gonic/gin/binding/toml.go b/vendor/github.com/gin-gonic/gin/binding/toml.go
index a6b8a90ab..a66b93aaf 100644
--- a/vendor/github.com/gin-gonic/gin/binding/toml.go
+++ b/vendor/github.com/gin-gonic/gin/binding/toml.go
@@ -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)
+}