Merge branch '8784-dir-listings'
[arvados.git] / sdk / go / keepclient / root_sorter.go
index c2780bc716171e7e1b96efd76ec2ed1fa2af26d5..afeb8028496532dc66550ddddf4bd15b285bc7e9 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
 package keepclient
 
 import (
@@ -5,12 +9,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 +30,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 +39,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]]