X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d3229c7f727f40436cad66fba5f3345e0b3eede5..c3d4f8a585202ec58df5506934b698039c200b68:/sdk/go/keepclient/root_sorter.go diff --git a/sdk/go/keepclient/root_sorter.go b/sdk/go/keepclient/root_sorter.go index c2780bc716..a8afea0961 100644 --- a/sdk/go/keepclient/root_sorter.go +++ b/sdk/go/keepclient/root_sorter.go @@ -5,12 +5,12 @@ import ( ) type RootSorter struct { - root []string - weight []string - order []int + root []string + weight []string + order []int } -func NewRootSorter(serviceRoots map[string]string, hash string) (*RootSorter) { +func NewRootSorter(serviceRoots map[string]string, hash string) *RootSorter { rs := new(RootSorter) rs.root = make([]string, len(serviceRoots)) rs.weight = make([]string, len(serviceRoots)) @@ -26,7 +26,7 @@ func NewRootSorter(serviceRoots map[string]string, hash string) (*RootSorter) { return rs } -func (rs RootSorter) getWeight(hash string, uuid string) (string) { +func (rs RootSorter) getWeight(hash string, uuid string) string { if len(uuid) == 27 { return Md5String(hash + uuid[12:]) } else { @@ -35,7 +35,7 @@ func (rs RootSorter) getWeight(hash string, uuid string) (string) { } } -func (rs RootSorter) GetSortedRoots() ([]string) { +func (rs RootSorter) GetSortedRoots() []string { sorted := make([]string, len(rs.order)) for i := range rs.order { sorted[i] = rs.root[rs.order[i]]