[arvados] updated: 2.1.0-2968-gb89ab7f92

git repository hosting git at public.arvados.org
Tue Oct 18 17:04:24 UTC 2022


Summary of changes:
 sdk/go/arvados/client.go        | 12 ++++++------
 sdk/go/arvados/config.go        |  8 +++++---
 sdk/go/arvados/duration_test.go | 10 ++++++++++
 sdk/go/arvados/fs_collection.go |  6 +++---
 4 files changed, 24 insertions(+), 12 deletions(-)

       via  b89ab7f9270acfabe9139d14d7071cf117b39bd4 (commit)
       via  7d2ec2603a42f6cae5552ab6dfd2a37a01e43ea8 (commit)
      from  99d3381ef145368617ecf92532201d79c9bb0ea7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b89ab7f9270acfabe9139d14d7071cf117b39bd4
Author: Tom Clegg <tom at curii.com>
Date:   Tue Oct 18 13:03:36 2022 -0400

    18863: gofmt
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go
index 4dead0ada..4d140517e 100644
--- a/sdk/go/arvados/client.go
+++ b/sdk/go/arvados/client.go
@@ -153,10 +153,10 @@ func NewClientFromConfig(cluster *Cluster) (*Client, error) {
 // Space characters are trimmed when reading the settings file, so
 // these are equivalent:
 //
-//   ARVADOS_API_HOST=localhost\n
-//   ARVADOS_API_HOST=localhost\r\n
-//   ARVADOS_API_HOST = localhost \n
-//   \tARVADOS_API_HOST = localhost\n
+//	ARVADOS_API_HOST=localhost\n
+//	ARVADOS_API_HOST=localhost\r\n
+//	ARVADOS_API_HOST = localhost \n
+//	\tARVADOS_API_HOST = localhost\n
 func NewClientFromEnv() *Client {
 	vars := map[string]string{}
 	home := os.Getenv("HOME")
@@ -330,11 +330,11 @@ func (c *Client) DoAndDecode(dst interface{}, req *http.Request) error {
 
 // Convert an arbitrary struct to url.Values. For example,
 //
-//     Foo{Bar: []int{1,2,3}, Baz: "waz"}
+//	Foo{Bar: []int{1,2,3}, Baz: "waz"}
 //
 // becomes
 //
-//     url.Values{`bar`:`{"a":[1,2,3]}`,`Baz`:`waz`}
+//	url.Values{`bar`:`{"a":[1,2,3]}`,`Baz`:`waz`}
 //
 // params itself is returned if it is already an url.Values.
 func anythingToValues(params interface{}) (url.Values, error) {
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 8705f2869..64b7fab8d 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -535,9 +535,11 @@ type InstanceTypeMap map[string]InstanceType
 var errDuplicateInstanceTypeName = errors.New("duplicate instance type name")
 
 // UnmarshalJSON does special handling of InstanceTypes:
-// * populate computed fields (Name and Scratch)
-// * error out if InstancesTypes are populated as an array, which was
-//   deprecated in Arvados 1.2.0
+//
+// - populate computed fields (Name and Scratch)
+//
+// - error out if InstancesTypes are populated as an array, which was
+// deprecated in Arvados 1.2.0
 func (it *InstanceTypeMap) UnmarshalJSON(data []byte) error {
 	fixup := func(t InstanceType) (InstanceType, error) {
 		if t.ProviderType == "" {
diff --git a/sdk/go/arvados/fs_collection.go b/sdk/go/arvados/fs_collection.go
index a26c876b9..354658a25 100644
--- a/sdk/go/arvados/fs_collection.go
+++ b/sdk/go/arvados/fs_collection.go
@@ -513,9 +513,9 @@ type filenodePtr struct {
 //
 // After seeking:
 //
-//     ptr.segmentIdx == len(filenode.segments) // i.e., at EOF
-//     ||
-//     filenode.segments[ptr.segmentIdx].Len() > ptr.segmentOff
+//	ptr.segmentIdx == len(filenode.segments) // i.e., at EOF
+//	||
+//	filenode.segments[ptr.segmentIdx].Len() > ptr.segmentOff
 func (fn *filenode) seek(startPtr filenodePtr) (ptr filenodePtr) {
 	ptr = startPtr
 	if ptr.off < 0 {

commit 7d2ec2603a42f6cae5552ab6dfd2a37a01e43ea8
Author: Tom Clegg <tom at curii.com>
Date:   Tue Oct 18 11:22:23 2022 -0400

    18863: Add tests for duration 0.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/sdk/go/arvados/duration_test.go b/sdk/go/arvados/duration_test.go
index 6a198e694..40344d061 100644
--- a/sdk/go/arvados/duration_test.go
+++ b/sdk/go/arvados/duration_test.go
@@ -60,4 +60,14 @@ func (s *DurationSuite) TestUnmarshalJSON(c *check.C) {
 	err = json.Unmarshal([]byte(`{"D":"60s"}`), &d)
 	c.Check(err, check.IsNil)
 	c.Check(d.D.Duration(), check.Equals, time.Minute)
+
+	d.D = Duration(time.Second)
+	err = json.Unmarshal([]byte(`{"D":"0"}`), &d)
+	c.Check(err, check.IsNil)
+	c.Check(d.D.Duration(), check.Equals, time.Duration(0))
+
+	d.D = Duration(time.Second)
+	err = json.Unmarshal([]byte(`{"D":0}`), &d)
+	c.Check(err, check.IsNil)
+	c.Check(d.D.Duration(), check.Equals, time.Duration(0))
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list