From: Ward Vandewege Date: Fri, 13 Nov 2020 01:02:56 +0000 (-0500) Subject: Fix more golint warnings. X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/988f00cbac42af1023a7b87bd79f78086e33e51f?ds=inline;hp=9e312753855286a7e21c83218bb48589f4d1535d Fix more golint warnings. No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go index d600322e6a..ec56e902c8 100644 --- a/sdk/go/keepclient/keepclient.go +++ b/sdk/go/keepclient/keepclient.go @@ -90,7 +90,7 @@ type HTTPClient interface { Do(*http.Request) (*http.Response, error) } -// Information about Arvados and Keep servers. +// KeepClient holds information about Arvados and Keep servers. type KeepClient struct { Arvados *arvadosclient.ArvadosClient Want_replicas int @@ -333,7 +333,7 @@ func (kc *KeepClient) LocalLocator(locator string) (string, error) { return loc, nil } -// Get() retrieves a block, given a locator. Returns a reader, the +// Get retrieves a block, given a locator. Returns a reader, the // expected data length, the URL the block is being fetched from, and // an error. // @@ -345,13 +345,13 @@ func (kc *KeepClient) Get(locator string) (io.ReadCloser, int64, string, error) return rdr, size, url, err } -// ReadAt() retrieves a portion of block from the cache if it's +// ReadAt retrieves a portion of block from the cache if it's // present, otherwise from the network. func (kc *KeepClient) ReadAt(locator string, p []byte, off int) (int, error) { return kc.cache().ReadAt(kc, locator, p, off) } -// Ask() verifies that a block with the given hash is available and +// Ask verifies that a block with the given hash is available and // readable, according to at least one Keep service. Unlike Get, it // does not retrieve the data or verify that the data content matches // the hash specified by the locator. @@ -416,7 +416,7 @@ func (kc *KeepClient) GetIndex(keepServiceUUID, prefix string) (io.Reader, error return bytes.NewReader(respBody[0 : len(respBody)-1]), nil } -// LocalRoots() returns the map of local (i.e., disk and proxy) Keep +// LocalRoots returns the map of local (i.e., disk and proxy) Keep // services: uuid -> baseURI. func (kc *KeepClient) LocalRoots() map[string]string { kc.discoverServices() @@ -425,7 +425,7 @@ func (kc *KeepClient) LocalRoots() map[string]string { return kc.localRoots } -// GatewayRoots() returns the map of Keep remote gateway services: +// GatewayRoots returns the map of Keep remote gateway services: // uuid -> baseURI. func (kc *KeepClient) GatewayRoots() map[string]string { kc.discoverServices() @@ -434,7 +434,7 @@ func (kc *KeepClient) GatewayRoots() map[string]string { return kc.gatewayRoots } -// WritableLocalRoots() returns the map of writable local Keep services: +// WritableLocalRoots returns the map of writable local Keep services: // uuid -> baseURI. func (kc *KeepClient) WritableLocalRoots() map[string]string { kc.discoverServices() diff --git a/sdk/go/keepclient/root_sorter_test.go b/sdk/go/keepclient/root_sorter_test.go index bd3bb0ba8e..a6fbaeded3 100644 --- a/sdk/go/keepclient/root_sorter_test.go +++ b/sdk/go/keepclient/root_sorter_test.go @@ -19,14 +19,14 @@ func FakeSvcRoot(i uint64) string { return fmt.Sprintf("https://%x.svc/", i) } -func FakeSvcUuid(i uint64) string { +func FakeSvcUUID(i uint64) string { return fmt.Sprintf("zzzzz-bi6l4-%015x", i) } func FakeServiceRoots(n uint64) map[string]string { sr := map[string]string{} for i := uint64(0); i < n; i++ { - sr[FakeSvcUuid(i)] = FakeSvcRoot(i) + sr[FakeSvcUUID(i)] = FakeSvcRoot(i) } return sr } @@ -45,19 +45,19 @@ func (*RootSorterSuite) ReferenceSet(c *C) { fakeroots := FakeServiceRoots(16) // These reference probe orders are explained further in // ../../python/tests/test_keep_client.py: - expected_orders := []string{ + expectedOrders := []string{ "3eab2d5fc9681074", "097dba52e648f1c3", "c5b4e023f8a7d691", "9d81c02e76a3bf54", } - for h, expected_order := range expected_orders { + for h, expectedOrder := range expectedOrders { hash := Md5String(fmt.Sprintf("%064x", h)) roots := NewRootSorter(fakeroots, hash).GetSortedRoots() - for i, svc_id_s := range strings.Split(expected_order, "") { - svc_id, err := strconv.ParseUint(svc_id_s, 16, 64) + for i, svcIDs := range strings.Split(expectedOrder, "") { + svcID, err := strconv.ParseUint(svcIDs, 16, 64) c.Assert(err, Equals, nil) - c.Check(roots[i], Equals, FakeSvcRoot(svc_id)) + c.Check(roots[i], Equals, FakeSvcRoot(svcID)) } } }