From: Eric Biagiotti Date: Wed, 13 Feb 2019 22:18:57 +0000 (-0500) Subject: 14745: Removes unneeded file and debug code and improves Duration comments X-Git-Tag: 1.4.0~149^2~3 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/8be52d226caaefc971492d6639d63761c1077c1f 14745: Removes unneeded file and debug code and improves Duration comments Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti --- diff --git a/lib/cloud/azure/azure_test.go b/lib/cloud/azure/azure_test.go index 0bf34280bd..850a3fb427 100644 --- a/lib/cloud/azure/azure_test.go +++ b/lib/cloud/azure/azure_test.go @@ -132,12 +132,6 @@ func GetInstanceSet() (cloud.InstanceSet, cloud.ImageID, arvados.Cluster, error) return nil, cloud.ImageID(""), cluster, err } - var azcfg azureInstanceSetConfig - err = json.Unmarshal(exampleCfg.DriverParameters, &azcfg) - if err != nil { - return nil, cloud.ImageID(exampleCfg.ImageIDForTestSuite), cluster, err - } - ap, err := newAzureInstanceSet(exampleCfg.DriverParameters, "test123", logrus.StandardLogger()) return ap, cloud.ImageID(exampleCfg.ImageIDForTestSuite), cluster, err } diff --git a/lib/cloud/gocheck_test.go b/lib/cloud/gocheck_test.go deleted file mode 100644 index d8392686ab..0000000000 --- a/lib/cloud/gocheck_test.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) The Arvados Authors. All rights reserved. -// -// SPDX-License-Identifier: AGPL-3.0 - -package cloud - -import ( - "testing" - - check "gopkg.in/check.v1" -) - -// Gocheck boilerplate -func Test(t *testing.T) { - check.TestingT(t) -} diff --git a/sdk/go/arvados/duration.go b/sdk/go/arvados/duration.go index fbbd53d50c..25eed010f2 100644 --- a/sdk/go/arvados/duration.go +++ b/sdk/go/arvados/duration.go @@ -14,7 +14,7 @@ import ( // a number of nanoseconds. type Duration time.Duration -// UnmarshalJSON implements json.Unmarshaler +// UnmarshalJSON implements json.Unmarshaler. func (d *Duration) UnmarshalJSON(data []byte) error { if data[0] == '"' { return d.Set(string(data[1 : len(data)-1])) @@ -22,22 +22,22 @@ func (d *Duration) UnmarshalJSON(data []byte) error { return fmt.Errorf("duration must be given as a string like \"600s\" or \"1h30m\"") } -// MarshalJSON implements json.Marshaler +// MarshalJSON implements json.Marshaler. func (d *Duration) MarshalJSON() ([]byte, error) { return json.Marshal(d.String()) } -// String implements fmt.Stringer +// String implements fmt.Stringer. func (d Duration) String() string { return time.Duration(d).String() } -// Duration returns a time.Duration +// Duration returns a time.Duration. func (d Duration) Duration() time.Duration { return time.Duration(d) } -// Set sets the current duration by parsing the string using time.ParseDuration +// Set implements the flag.Value interface and sets the duration value by using time.ParseDuration to parse the string. func (d *Duration) Set(s string) error { dur, err := time.ParseDuration(s) *d = Duration(dur)