We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7abcb6f commit 7f56e3dCopy full SHA for 7f56e3d
cmd/cli/cli.go
@@ -619,16 +619,15 @@ type attribute struct {
619
620
type attributeList []attribute
621
622
-func (a attributeList) Len() int { return len(a) }
623
-func (a attributeList) Less(i, j int) bool { return a[i].key < a[j].key }
624
-func (a attributeList) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
625
-
626
func sortedAttributes(attrs toxiproxy.Attributes) attributeList {
627
li := make(attributeList, 0, len(attrs))
628
for k, v := range attrs {
629
- li = append(li, attribute{k, v.(float64)})
+ li = append(li, attribute{k, v})
630
}
631
- sort.Sort(li)
+ sort.Slice(li, func(i, j int) bool {
+ return li[i].key < li[j].key
+ })
+
632
return li
633
634
0 commit comments