xml.go
This file
Path
binding/xml.go
34 lines · 677 bytes · Go
Last changed by
ci(golangci-lint): update configuration and fix lint issues (#4247)Flc゛before adoptionc4287b1
History of this fileTake it
The walk stopped after 200 commits: lines older than cf32d2d point at it.
chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d
lines 1–26why, one step back1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package binding67import (8 "bytes"9 "encoding/xml"10 "io"11 "net/http"12)1314type xmlBinding struct{}1516func (xmlBinding) Name() string {17 return "xml"18}1920func (xmlBinding) Bind(req *http.Request, obj any) error {21 return decodeXML(req.Body, obj)22}2324func (xmlBinding) BindBody(body []byte, obj any) error {25 return decodeXML(bytes.NewReader(body), obj)26}ci(golangci-lint): update configuration and fix lint issues (#4247)Flc゛before adoptionc4287b1
line 27why, one step back27chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d
lines 28–34why, one step back28func decodeXML(r io.Reader, obj any) error {29 decoder := xml.NewDecoder(r)30 if err := decoder.Decode(obj); err != nil {31 return err32 }33 return validate(obj)34}