Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for labelsSorted (0.72 sec)

  1. src/runtime/pprof/label_test.go

    	"reflect"
    	"sort"
    	"testing"
    )
    
    func labelsSorted(ctx context.Context) []label {
    	ls := []label{}
    	ForLabels(ctx, func(key, value string) bool {
    		ls = append(ls, label{key, value})
    		return true
    	})
    	sort.Sort(labelSorter(ls))
    	return ls
    }
    
    type labelSorter []label
    
    func (s labelSorter) Len() int           { return len(s) }
    func (s labelSorter) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 3.4K bytes
    - Viewed (0)
Back to top