You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
364 B

  1. package matchers
  2. import (
  3. "encoding/xml"
  4. "strings"
  5. )
  6. type attributesSlice []xml.Attr
  7. func (attrs attributesSlice) Len() int { return len(attrs) }
  8. func (attrs attributesSlice) Less(i, j int) bool {
  9. return strings.Compare(attrs[i].Name.Local, attrs[j].Name.Local) == -1
  10. }
  11. func (attrs attributesSlice) Swap(i, j int) { attrs[i], attrs[j] = attrs[j], attrs[i] }