summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/gomega/matchers/attributes_slice.go
blob: 355b362f4b076de08d004db619adda12d85ed397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package matchers

import (
	"encoding/xml"
	"strings"
)

type attributesSlice []xml.Attr

func (attrs attributesSlice) Len() int { return len(attrs) }
func (attrs attributesSlice) Less(i, j int) bool {
	return strings.Compare(attrs[i].Name.Local, attrs[j].Name.Local) == -1
}
func (attrs attributesSlice) Swap(i, j int) { attrs[i], attrs[j] = attrs[j], attrs[i] }