14745: Removes unneeded file and debug code and improves Duration comments
authorEric Biagiotti <ebiagiotti@veritasgenetcs.com>
Wed, 13 Feb 2019 22:18:57 +0000 (17:18 -0500)
committerEric Biagiotti <ebiagiotti@veritasgenetcs.com>
Wed, 13 Feb 2019 22:18:57 +0000 (17:18 -0500)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <eric.biagiotti@gmail.com>

lib/cloud/azure/azure_test.go
lib/cloud/gocheck_test.go [deleted file]
sdk/go/arvados/duration.go

index 0bf34280bdf740e2d6db6f1c6cfcb38c9341e9df..850a3fb4270fd9c5da7b7829e9f00fa27c630a49 100644 (file)
@@ -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 (file)
index d839268..0000000
+++ /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)
-}
index fbbd53d50c452c9ab7d4b66ded69e7aa2d91bbe1..25eed010f26c534ef8e36dfa119065731d1e2ac4 100644 (file)
@@ -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)