forked from TrueCloudLab/rclone
vendor: update all dependencies
This commit is contained in:
parent
3dcf1e61cf
commit
479c803fd9
446 changed files with 25054 additions and 8064 deletions
32
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go
generated
vendored
Normal file
32
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
package xmlutil
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type xmlAttrSlice []xml.Attr
|
||||
|
||||
func (x xmlAttrSlice) Len() int {
|
||||
return len(x)
|
||||
}
|
||||
|
||||
func (x xmlAttrSlice) Less(i, j int) bool {
|
||||
spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space
|
||||
localI, localJ := x[i].Name.Local, x[j].Name.Local
|
||||
valueI, valueJ := x[i].Value, x[j].Value
|
||||
|
||||
spaceCmp := strings.Compare(spaceI, spaceJ)
|
||||
localCmp := strings.Compare(localI, localJ)
|
||||
valueCmp := strings.Compare(valueI, valueJ)
|
||||
|
||||
if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (x xmlAttrSlice) Swap(i, j int) {
|
||||
x[i], x[j] = x[j], x[i]
|
||||
}
|
13
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
generated
vendored
13
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
generated
vendored
|
@ -119,7 +119,18 @@ func (n *XMLNode) findElem(name string) (string, bool) {
|
|||
|
||||
// StructToXML writes an XMLNode to a xml.Encoder as tokens.
|
||||
func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {
|
||||
e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})
|
||||
// Sort Attributes
|
||||
attrs := node.Attr
|
||||
if sorted {
|
||||
sortedAttrs := make([]xml.Attr, len(attrs))
|
||||
for _, k := range node.Attr {
|
||||
sortedAttrs = append(sortedAttrs, k)
|
||||
}
|
||||
sort.Sort(xmlAttrSlice(sortedAttrs))
|
||||
attrs = sortedAttrs
|
||||
}
|
||||
|
||||
e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs})
|
||||
|
||||
if node.Text != "" {
|
||||
e.EncodeToken(xml.CharData([]byte(node.Text)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue