9437: gofmt
authorTom Clegg <tom@curoverse.com>
Thu, 23 Jun 2016 20:22:56 +0000 (16:22 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 1 Jul 2016 17:53:12 +0000 (13:53 -0400)
18 files changed:
sdk/go/arvados/client_test.go
sdk/go/crunchrunner/crunchrunner_test.go
sdk/go/keepclient/collectionreader.go
services/crunch-dispatch-local/crunch-dispatch-local.go
services/crunch-dispatch-local/crunch-dispatch-local_test.go
services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
services/crunch-run/crunchrun.go
services/crunchstat/crunchstat_test.go
services/datamanager/collection/collection.go
services/datamanager/collection/collection_test.go
services/datamanager/keep/keep.go
services/datamanager/keep/keep_test.go
services/datamanager/summary/pull_list_test.go
services/datamanager/summary/summary_test.go
services/datamanager/summary/trash_list_test.go
services/keep-balance/balance.go
services/keepstore/s3_volume.go
services/keepstore/work_queue_test.go

index 422ad9037acc45ed6a2a39b9f8be5ab9bedcf3c8..5011aa81f689c0bf1d6098c123bcaeee14ba6c41 100644 (file)
@@ -117,7 +117,7 @@ func TestAnythingToValues(t *testing.T) {
                        },
                },
                {
-                       in: map[string]interface{}{"foo": map[string]interface{}{"bar":1.234}},
+                       in: map[string]interface{}{"foo": map[string]interface{}{"bar": 1.234}},
                        ok: func(out url.Values) bool {
                                return out.Get("foo") == `{"bar":1.234}`
                        },
index 52d5c1a64e5181fe78aecf891057dc89b18bc836..9805412d13fd5fb53d6809eee9a7e9d379ef74eb 100644 (file)
@@ -53,7 +53,7 @@ func (s *TestSuite) TestSimpleRun(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"echo", "foo"}}}}},
                Task{Sequence: 0})
        c.Check(err, IsNil)
@@ -89,8 +89,8 @@ func (s *TestSuite) TestSimpleRunSubtask(c *C) {
                tmpdir,
                "",
                Job{Script_parameters: Tasks{[]TaskDef{
-                       TaskDef{Command: []string{"echo", "bar"}},
-                       TaskDef{Command: []string{"echo", "foo"}}}}},
+                       {Command: []string{"echo", "bar"}},
+                       {Command: []string{"echo", "foo"}}}}},
                Task{Parameters: TaskDef{
                        Command: []string{"echo", "foo"},
                        Stdout:  "output.txt"},
@@ -118,7 +118,7 @@ func (s *TestSuite) TestRedirect(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"cat"},
                        Stdout:  "output.txt",
                        Stdin:   tmpfile.Name()}}}},
@@ -140,7 +140,7 @@ func (s *TestSuite) TestEnv(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"/bin/sh", "-c", "echo $BAR"},
                        Stdout:  "output.txt",
                        Env:     map[string]string{"BAR": "foo"}}}}},
@@ -161,7 +161,7 @@ func (s *TestSuite) TestEnvSubstitute(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "foo\n",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"/bin/sh", "-c", "echo $BAR"},
                        Stdout:  "output.txt",
                        Env:     map[string]string{"BAR": "$(task.keep)"}}}}},
@@ -182,7 +182,7 @@ func (s *TestSuite) TestEnvReplace(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"/bin/sh", "-c", "echo $PATH"},
                        Stdout:  "output.txt",
                        Env:     map[string]string{"PATH": "foo"}}}}},
@@ -211,12 +211,12 @@ func (t SubtaskTestClient) Update(resourceType string, uuid string, parameters a
 func (s *TestSuite) TestScheduleSubtask(c *C) {
 
        api := SubtaskTestClient{c, []Task{
-               Task{Job_uuid: "zzzz-8i9sb-111111111111111",
+               {Job_uuid: "zzzz-8i9sb-111111111111111",
                        Created_by_job_task_uuid: "zzzz-ot0gb-111111111111111",
                        Sequence:                 1,
                        Parameters: TaskDef{
                                Command: []string{"echo", "bar"}}},
-               Task{Job_uuid: "zzzz-8i9sb-111111111111111",
+               {Job_uuid: "zzzz-8i9sb-111111111111111",
                        Created_by_job_task_uuid: "zzzz-ot0gb-111111111111111",
                        Sequence:                 1,
                        Parameters: TaskDef{
@@ -234,8 +234,8 @@ func (s *TestSuite) TestScheduleSubtask(c *C) {
                tmpdir,
                "",
                Job{Script_parameters: Tasks{[]TaskDef{
-                       TaskDef{Command: []string{"echo", "bar"}},
-                       TaskDef{Command: []string{"echo", "foo"}}}}},
+                       {Command: []string{"echo", "bar"}},
+                       {Command: []string{"echo", "foo"}}}}},
                Task{Sequence: 0})
        c.Check(err, IsNil)
 
@@ -252,7 +252,7 @@ func (s *TestSuite) TestRunFail(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"/bin/sh", "-c", "exit 1"}}}}},
                Task{Sequence: 0})
        c.Check(err, FitsTypeOf, PermFail{})
@@ -269,7 +269,7 @@ func (s *TestSuite) TestRunSuccessCode(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command:      []string{"/bin/sh", "-c", "exit 1"},
                        SuccessCodes: []int{0, 1}}}}},
                Task{Sequence: 0})
@@ -287,7 +287,7 @@ func (s *TestSuite) TestRunFailCode(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command:            []string{"/bin/sh", "-c", "exit 0"},
                        PermanentFailCodes: []int{0, 1}}}}},
                Task{Sequence: 0})
@@ -305,7 +305,7 @@ func (s *TestSuite) TestRunTempFailCode(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command:            []string{"/bin/sh", "-c", "exit 1"},
                        TemporaryFailCodes: []int{1}}}}},
                Task{Sequence: 0})
@@ -329,7 +329,7 @@ func (s *TestSuite) TestVwd(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"ls", "output.txt"},
                        Vwd: map[string]string{
                                "output.txt": tmpfile.Name()}}}}},
@@ -361,7 +361,7 @@ func (s *TestSuite) TestSubstitutionStdin(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                keepmount,
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"cat"},
                        Stdout:  "output.txt",
                        Stdin:   "$(task.keep)/file1.txt"}}}},
@@ -389,7 +389,7 @@ func (s *TestSuite) TestSubstitutionCommandLine(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                keepmount,
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"cat", "$(task.keep)/file1.txt"},
                        Stdout:  "output.txt"}}}},
                Task{Sequence: 0})
@@ -417,7 +417,7 @@ func (s *TestSuite) TestSignal(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"sleep", "4"}}}}},
                Task{Sequence: 0})
        c.Check(err, FitsTypeOf, PermFail{})
@@ -437,7 +437,7 @@ func (s *TestSuite) TestQuoting(c *C) {
                "zzzz-ot0gb-111111111111111",
                tmpdir,
                "",
-               Job{Script_parameters: Tasks{[]TaskDef{TaskDef{
+               Job{Script_parameters: Tasks{[]TaskDef{{
                        Command: []string{"echo", "foo"},
                        Stdout:  "s ub:dir/:e vi\nl"}}}},
                Task{Sequence: 0})
index bed60f499562a36c4585018932860fe35df34701..33bb58710e0c94e1cfa562b8bd1c56afff62a4d7 100644 (file)
@@ -243,7 +243,7 @@ GET:
        // In case we exited the above loop early: before returning,
        // drain the toGet channel so its sender doesn't sit around
        // blocking forever.
-       for _ = range r.toGet {
+       for range r.toGet {
        }
 }
 
index 936a9088ed0c3d3affe6c3e0f9555d9e230d0c99..0ca765185119c152dd11870641c15f905042311e 100644 (file)
@@ -168,7 +168,7 @@ func run(dispatcher *dispatch.Dispatcher,
        }
 
        // drain any subsequent status changes
-       for _ = range status {
+       for range status {
        }
 
        log.Printf("Finalized container %v", uuid)
index 9628bf2f0aac3beb8ccc58768d1498fc3371a9a2..17f9d671a7fdcb084005ea34cdd6c134cd2e3524 100644 (file)
@@ -88,7 +88,7 @@ func (s *TestSuite) TestIntegration(c *C) {
 
        // There should be no queued containers now
        params := arvadosclient.Dict{
-               "filters": [][]string{[]string{"state", "=", "Queued"}},
+               "filters": [][]string{{"state", "=", "Queued"}},
        }
        var containers arvados.ContainerList
        err = arv.List("containers", params, &containers)
index b72ad9fa9dea802bd30a9aa70d84c817493cec0f..d8b94f98d2d2d298f83423d621169acf937251b1 100644 (file)
@@ -136,7 +136,7 @@ func (s *TestSuite) integrationTest(c *C,
 
        // There should be no queued containers now
        params := arvadosclient.Dict{
-               "filters": [][]string{[]string{"state", "=", "Queued"}},
+               "filters": [][]string{{"state", "=", "Queued"}},
        }
        var containers arvados.ContainerList
        err = arv.List("containers", params, &containers)
index 7da1beb20a4d5e4986eec2f8643d1ae99edeea2f..2fd002907cb6e5d15c9928049fab2de9684ee06e 100644 (file)
@@ -102,7 +102,7 @@ func (runner *ContainerRunner) SetupSignals() {
        signal.Notify(runner.SigChan, syscall.SIGQUIT)
 
        go func(sig <-chan os.Signal) {
-               for _ = range sig {
+               for range sig {
                        if !runner.Cancelled {
                                runner.CancelLock.Lock()
                                runner.Cancelled = true
index 69f31afbc9589ce6cd6c9de2a731d5093e2c80cd..fe95f03175f14df6dcfa391787e547fb466ac5cf 100644 (file)
@@ -89,7 +89,7 @@ func TestCopyPipeToChildLogLongLines(t *testing.T) {
                        }
                        line = line[5:]
                }
-               if len(line) >= 6 && string(line[len(line)-6:len(line)]) == "[...]\n" {
+               if len(line) >= 6 && string(line[len(line)-6:]) == "[...]\n" {
                        line = line[:len(line)-6]
                } else {
                        done = true
index 55b3f61c4e5ee32bcff3fab7082fda7334f08be4..5fcacffb7819e2eeee23475801fa98b729eeb969 100644 (file)
@@ -49,11 +49,11 @@ type GetCollectionsParams struct {
 
 // SdkCollectionInfo holds collection info from api
 type SdkCollectionInfo struct {
-       UUID                 string    `json:"uuid"`
-       OwnerUUID            string    `json:"owner_uuid"`
-       ReplicationDesired   int       `json:"replication_desired"`
-       ModifiedAt           time.Time `json:"modified_at"`
-       ManifestText         string    `json:"manifest_text"`
+       UUID               string    `json:"uuid"`
+       OwnerUUID          string    `json:"owner_uuid"`
+       ReplicationDesired int       `json:"replication_desired"`
+       ModifiedAt         time.Time `json:"modified_at"`
+       ManifestText       string    `json:"manifest_text"`
 }
 
 // SdkCollectionList lists collections from api
@@ -131,7 +131,7 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections, err e
        sdkParams := arvadosclient.Dict{
                "select":  fieldsWanted,
                "order":   []string{"modified_at ASC", "uuid ASC"},
-               "filters": [][]string{[]string{"modified_at", ">=", "1900-01-01T00:00:00Z"}},
+               "filters": [][]string{{"modified_at", ">=", "1900-01-01T00:00:00Z"}},
                "offset":  0}
 
        if params.BatchSize > 0 {
index 47ab5fa4a8a6793f9712ebb4ba1ff5a9aea503aa..b23ef2cf0e4d658677e34847b73be12872653b21 100644 (file)
@@ -64,7 +64,7 @@ func CompareSummarizedReadCollections(c *C,
 }
 
 func (s *MySuite) TestSummarizeSimple(checker *C) {
-       rc := MakeTestReadCollections([]TestCollectionSpec{TestCollectionSpec{
+       rc := MakeTestReadCollections([]TestCollectionSpec{{
                ReplicationLevel: 5,
                Blocks:           []int{1, 2},
        }})
@@ -79,7 +79,7 @@ func (s *MySuite) TestSummarizeSimple(checker *C) {
        expected := ExpectedSummary{
                OwnerToCollectionSize:     map[string]int{c.OwnerUUID: c.TotalSize},
                BlockToDesiredReplication: map[blockdigest.DigestWithSize]int{blockDigest1: 5, blockDigest2: 5},
-               BlockToCollectionUuids:    map[blockdigest.DigestWithSize][]string{blockDigest1: []string{c.UUID}, blockDigest2: []string{c.UUID}},
+               BlockToCollectionUuids:    map[blockdigest.DigestWithSize][]string{blockDigest1: {c.UUID}, blockDigest2: {c.UUID}},
        }
 
        CompareSummarizedReadCollections(checker, rc, expected)
@@ -87,11 +87,11 @@ func (s *MySuite) TestSummarizeSimple(checker *C) {
 
 func (s *MySuite) TestSummarizeOverlapping(checker *C) {
        rc := MakeTestReadCollections([]TestCollectionSpec{
-               TestCollectionSpec{
+               {
                        ReplicationLevel: 5,
                        Blocks:           []int{1, 2},
                },
-               TestCollectionSpec{
+               {
                        ReplicationLevel: 8,
                        Blocks:           []int{2, 3},
                },
@@ -117,9 +117,9 @@ func (s *MySuite) TestSummarizeOverlapping(checker *C) {
                        blockDigest3: 8,
                },
                BlockToCollectionUuids: map[blockdigest.DigestWithSize][]string{
-                       blockDigest1: []string{c0.UUID},
-                       blockDigest2: []string{c0.UUID, c1.UUID},
-                       blockDigest3: []string{c1.UUID},
+                       blockDigest1: {c0.UUID},
+                       blockDigest2: {c0.UUID, c1.UUID},
+                       blockDigest3: {c1.UUID},
                },
        }
 
index 206a9c43fd4878babf0d9a5340a68b787b15b71a..e7843ea02f8090133a4270465ba2330f579f3be5 100644 (file)
@@ -118,7 +118,7 @@ func GetKeepServersAndSummarize(params GetKeepServersParams) (results ReadServer
 // GetKeepServers from api server
 func GetKeepServers(params GetKeepServersParams) (results ReadServers, err error) {
        sdkParams := arvadosclient.Dict{
-               "filters": [][]string{[]string{"service_type", "!=", "proxy"}},
+               "filters": [][]string{{"service_type", "!=", "proxy"}},
        }
        if params.Limit > 0 {
                sdkParams["limit"] = params.Limit
index 79ff3f8f0763b1c2452e63afe9b8d553fbab84b1..66988498481bf848d0ace840abb6bf838e9f7cf9 100644 (file)
@@ -43,7 +43,7 @@ func (s *KeepSuite) TestSendTrashLists(c *C) {
        defer server.Close()
 
        tl := map[string]TrashList{
-               server.URL: TrashList{TrashRequest{"000000000000000000000000deadbeef", 99}}}
+               server.URL: {TrashRequest{"000000000000000000000000deadbeef", 99}}}
 
        arv := arvadosclient.ArvadosClient{ApiToken: "abc123"}
        kc := keepclient.KeepClient{Arvados: &arv, Client: &http.Client{}}
@@ -70,7 +70,7 @@ func (tse *TestHandlerError) ServeHTTP(writer http.ResponseWriter, req *http.Req
 
 func sendTrashListError(c *C, server *httptest.Server) {
        tl := map[string]TrashList{
-               server.URL: TrashList{TrashRequest{"000000000000000000000000deadbeef", 99}}}
+               server.URL: {TrashRequest{"000000000000000000000000deadbeef", 99}}}
 
        arv := arvadosclient.ArvadosClient{ApiToken: "abc123"}
        kc := keepclient.KeepClient{Arvados: &arv, Client: &http.Client{}}
index e2050c2b1ebefbc42bf950fc1ad30121d63b9c84..60b495c41a89799a34d40d7bce649d0af0c9a5fb 100644 (file)
@@ -164,69 +164,69 @@ func (s *PullSuite) TestBuildPullLists(c *C) {
        locator1 := Locator{Digest: blockdigest.MakeTestBlockDigest(0xBadBeef)}
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{To: []string{}, From: []string{}}}),
+                       locator1: {To: []string{}, From: []string{}}}),
                PullListMapEquals,
                map[string]PullList{})
 
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{To: []string{}, From: []string{"f1", "f2"}}}),
+                       locator1: {To: []string{}, From: []string{"f1", "f2"}}}),
                PullListMapEquals,
                map[string]PullList{})
 
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{To: []string{"t1"}, From: []string{"f1", "f2"}}}),
+                       locator1: {To: []string{"t1"}, From: []string{"f1", "f2"}}}),
                PullListMapEquals,
                map[string]PullList{
-                       "t1": PullList{PullRequest{locator1, []string{"f1", "f2"}}}})
+                       "t1": {PullRequest{locator1, []string{"f1", "f2"}}}})
 
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{To: []string{"t1"}, From: []string{}}}),
+                       locator1: {To: []string{"t1"}, From: []string{}}}),
                PullListMapEquals,
-               map[string]PullList{"t1": PullList{
+               map[string]PullList{"t1": {
                        PullRequest{locator1, []string{}}}})
 
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{
+                       locator1: {
                                To:   []string{"t1", "t2"},
                                From: []string{"f1", "f2"},
                        }}),
                PullListMapEquals,
                map[string]PullList{
-                       "t1": PullList{PullRequest{locator1, []string{"f1", "f2"}}},
-                       "t2": PullList{PullRequest{locator1, []string{"f1", "f2"}}},
+                       "t1": {PullRequest{locator1, []string{"f1", "f2"}}},
+                       "t2": {PullRequest{locator1, []string{"f1", "f2"}}},
                })
 
        locator2 := Locator{Digest: blockdigest.MakeTestBlockDigest(0xCabbed)}
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{To: []string{"t1"}, From: []string{"f1", "f2"}},
-                       locator2: PullServers{To: []string{"t2"}, From: []string{"f3", "f4"}}}),
+                       locator1: {To: []string{"t1"}, From: []string{"f1", "f2"}},
+                       locator2: {To: []string{"t2"}, From: []string{"f3", "f4"}}}),
                PullListMapEquals,
                map[string]PullList{
-                       "t1": PullList{PullRequest{locator1, []string{"f1", "f2"}}},
-                       "t2": PullList{PullRequest{locator2, []string{"f3", "f4"}}},
+                       "t1": {PullRequest{locator1, []string{"f1", "f2"}}},
+                       "t2": {PullRequest{locator2, []string{"f3", "f4"}}},
                })
 
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{
+                       locator1: {
                                To:   []string{"t1"},
                                From: []string{"f1", "f2"}},
-                       locator2: PullServers{
+                       locator2: {
                                To:   []string{"t2", "t1"},
                                From: []string{"f3", "f4"}},
                }),
                PullListMapEquals,
                map[string]PullList{
-                       "t1": PullList{
+                       "t1": {
                                PullRequest{locator1, []string{"f1", "f2"}},
                                PullRequest{locator2, []string{"f3", "f4"}},
                        },
-                       "t2": PullList{
+                       "t2": {
                                PullRequest{locator2, []string{"f3", "f4"}},
                        },
                })
@@ -235,37 +235,37 @@ func (s *PullSuite) TestBuildPullLists(c *C) {
        locator4 := Locator{Digest: blockdigest.MakeTestBlockDigest(0xFedBeef)}
        c.Check(
                BuildPullLists(map[Locator]PullServers{
-                       locator1: PullServers{
+                       locator1: {
                                To:   []string{"t1"},
                                From: []string{"f1", "f2"}},
-                       locator2: PullServers{
+                       locator2: {
                                To:   []string{"t2", "t1"},
                                From: []string{"f3", "f4"}},
-                       locator3: PullServers{
+                       locator3: {
                                To:   []string{"t3", "t2", "t1"},
                                From: []string{"f4", "f5"}},
-                       locator4: PullServers{
+                       locator4: {
                                To:   []string{"t4", "t3", "t2", "t1"},
                                From: []string{"f1", "f5"}},
                }),
                PullListMapEquals,
                map[string]PullList{
-                       "t1": PullList{
+                       "t1": {
                                PullRequest{locator1, []string{"f1", "f2"}},
                                PullRequest{locator2, []string{"f3", "f4"}},
                                PullRequest{locator3, []string{"f4", "f5"}},
                                PullRequest{locator4, []string{"f1", "f5"}},
                        },
-                       "t2": PullList{
+                       "t2": {
                                PullRequest{locator2, []string{"f3", "f4"}},
                                PullRequest{locator3, []string{"f4", "f5"}},
                                PullRequest{locator4, []string{"f1", "f5"}},
                        },
-                       "t3": PullList{
+                       "t3": {
                                PullRequest{locator3, []string{"f4", "f5"}},
                                PullRequest{locator4, []string{"f1", "f5"}},
                        },
-                       "t4": PullList{
+                       "t4": {
                                PullRequest{locator4, []string{"f1", "f5"}},
                        },
                })
index cc4eb92560b26b385378ffa6d947abb2bc9f0168..82684041275ff602236823b68da5ef2fab6714cf 100644 (file)
@@ -85,21 +85,21 @@ func VerifyToCollectionIndexSet(
 }
 
 func TestToCollectionIndexSet(t *testing.T) {
-       VerifyToCollectionIndexSet(t, []int{6}, map[int][]int{6: []int{0}}, []int{0})
-       VerifyToCollectionIndexSet(t, []int{4}, map[int][]int{4: []int{1}}, []int{1})
-       VerifyToCollectionIndexSet(t, []int{4}, map[int][]int{4: []int{1, 9}}, []int{1, 9})
+       VerifyToCollectionIndexSet(t, []int{6}, map[int][]int{6: {0}}, []int{0})
+       VerifyToCollectionIndexSet(t, []int{4}, map[int][]int{4: {1}}, []int{1})
+       VerifyToCollectionIndexSet(t, []int{4}, map[int][]int{4: {1, 9}}, []int{1, 9})
        VerifyToCollectionIndexSet(t, []int{5, 6},
-               map[int][]int{5: []int{2, 3}, 6: []int{3, 4}},
+               map[int][]int{5: {2, 3}, 6: {3, 4}},
                []int{2, 3, 4})
        VerifyToCollectionIndexSet(t, []int{5, 6},
-               map[int][]int{5: []int{8}, 6: []int{4}},
+               map[int][]int{5: {8}, 6: {4}},
                []int{4, 8})
-       VerifyToCollectionIndexSet(t, []int{6}, map[int][]int{5: []int{0}}, []int{})
+       VerifyToCollectionIndexSet(t, []int{6}, map[int][]int{5: {0}}, []int{})
 }
 
 func TestSimpleSummary(t *testing.T) {
        rc := collection.MakeTestReadCollections([]collection.TestCollectionSpec{
-               collection.TestCollectionSpec{ReplicationLevel: 1, Blocks: []int{1, 2}},
+               {ReplicationLevel: 1, Blocks: []int{1, 2}},
        })
        rc.Summarize(nil)
        cIndex := rc.CollectionIndicesForTesting()
@@ -128,7 +128,7 @@ func TestSimpleSummary(t *testing.T) {
 
 func TestMissingBlock(t *testing.T) {
        rc := collection.MakeTestReadCollections([]collection.TestCollectionSpec{
-               collection.TestCollectionSpec{ReplicationLevel: 1, Blocks: []int{1, 2}},
+               {ReplicationLevel: 1, Blocks: []int{1, 2}},
        })
        rc.Summarize(nil)
        cIndex := rc.CollectionIndicesForTesting()
@@ -159,7 +159,7 @@ func TestMissingBlock(t *testing.T) {
 
 func TestUnderAndOverReplicatedBlocks(t *testing.T) {
        rc := collection.MakeTestReadCollections([]collection.TestCollectionSpec{
-               collection.TestCollectionSpec{ReplicationLevel: 2, Blocks: []int{1, 2}},
+               {ReplicationLevel: 2, Blocks: []int{1, 2}},
        })
        rc.Summarize(nil)
        cIndex := rc.CollectionIndicesForTesting()
@@ -190,9 +190,9 @@ func TestUnderAndOverReplicatedBlocks(t *testing.T) {
 
 func TestMixedReplication(t *testing.T) {
        rc := collection.MakeTestReadCollections([]collection.TestCollectionSpec{
-               collection.TestCollectionSpec{ReplicationLevel: 1, Blocks: []int{1, 2}},
-               collection.TestCollectionSpec{ReplicationLevel: 1, Blocks: []int{3, 4}},
-               collection.TestCollectionSpec{ReplicationLevel: 2, Blocks: []int{5, 6}},
+               {ReplicationLevel: 1, Blocks: []int{1, 2}},
+               {ReplicationLevel: 1, Blocks: []int{3, 4}},
+               {ReplicationLevel: 2, Blocks: []int{5, 6}},
        })
        rc.Summarize(nil)
        cIndex := rc.CollectionIndicesForTesting()
index 555211fe0275e9a42b49625557f8d505999b9c2d..3626904f3309743f08c6f23a5b1185e6ccd5b886 100644 (file)
@@ -26,12 +26,12 @@ func (s *TrashSuite) TestBuildTrashLists(c *C) {
        var keepServerInfo = keep.ReadServers{
                KeepServerIndexToAddress: []keep.ServerAddress{sv0, sv1},
                BlockToServers: map[blockdigest.DigestWithSize][]keep.BlockServerInfo{
-                       block0: []keep.BlockServerInfo{
-                               keep.BlockServerInfo{0, 99},
-                               keep.BlockServerInfo{1, 101}},
-                       block1: []keep.BlockServerInfo{
-                               keep.BlockServerInfo{0, 99},
-                               keep.BlockServerInfo{1, 101}}}}
+                       block0: {
+                               {0, 99},
+                               {1, 101}},
+                       block1: {
+                               {0, 99},
+                               {1, 101}}}}
 
        // only block0 is in delete set
        var bs = make(BlockSet)
@@ -40,37 +40,37 @@ func (s *TrashSuite) TestBuildTrashLists(c *C) {
        // Test trash list where only sv0 is on writable list.
        c.Check(buildTrashListsInternal(
                map[string]struct{}{
-                       sv0.URL(): struct{}{}},
+                       sv0.URL(): {}},
                &keepServerInfo,
                110,
                bs),
                DeepEquals,
                map[string]keep.TrashList{
-                       "http://keep0.example.com:80": keep.TrashList{keep.TrashRequest{"000000000000000000000000deadbeef", 99}}})
+                       "http://keep0.example.com:80": {keep.TrashRequest{"000000000000000000000000deadbeef", 99}}})
 
        // Test trash list where both sv0 and sv1 are on writable list.
        c.Check(buildTrashListsInternal(
                map[string]struct{}{
-                       sv0.URL(): struct{}{},
-                       sv1.URL(): struct{}{}},
+                       sv0.URL(): {},
+                       sv1.URL(): {}},
                &keepServerInfo,
                110,
                bs),
                DeepEquals,
                map[string]keep.TrashList{
-                       "http://keep0.example.com:80": keep.TrashList{keep.TrashRequest{"000000000000000000000000deadbeef", 99}},
-                       "http://keep1.example.com:80": keep.TrashList{keep.TrashRequest{"000000000000000000000000deadbeef", 101}}})
+                       "http://keep0.example.com:80": {keep.TrashRequest{"000000000000000000000000deadbeef", 99}},
+                       "http://keep1.example.com:80": {keep.TrashRequest{"000000000000000000000000deadbeef", 101}}})
 
        // Test trash list where only block on sv0 is expired
        c.Check(buildTrashListsInternal(
                map[string]struct{}{
-                       sv0.URL(): struct{}{},
-                       sv1.URL(): struct{}{}},
+                       sv0.URL(): {},
+                       sv1.URL(): {}},
                &keepServerInfo,
                100,
                bs),
                DeepEquals,
                map[string]keep.TrashList{
-                       "http://keep0.example.com:80": keep.TrashList{keep.TrashRequest{"000000000000000000000000deadbeef", 99}}})
+                       "http://keep0.example.com:80": {keep.TrashRequest{"000000000000000000000000deadbeef", 99}}})
 
 }
index fa585d3aeb90e089e16ae041e0a3955f725b3f24..d22074e000cb2ae6d3c99ec7afdda65980e5f80a 100644 (file)
@@ -619,7 +619,7 @@ func (bal *Balancer) commitAsync(c *arvados.Client, label string, f func(srv *Ke
                }(srv)
        }
        var lastErr error
-       for _ = range bal.KeepServices {
+       for range bal.KeepServices {
                if err := <-errs; err != nil {
                        bal.logf("%v", err)
                        lastErr = err
index b1b198d02de6dc0c158dfacdade39c1d9de53a16..98e12034f84922d0c6bb7c94ceeeda68888a9561 100644 (file)
@@ -86,7 +86,7 @@ func (s *s3VolumeAdder) Set(bucketName string) error {
 }
 
 func s3regions() (okList []string) {
-       for r, _ := range aws.Regions {
+       for r := range aws.Regions {
                okList = append(okList, r)
        }
        return
index 74c67f2dd0a6c1ee69748d24c162d95b5c98b16a..6b31795293ebd38eaa3837316fe001519c91b072 100644 (file)
@@ -98,7 +98,7 @@ func TestWorkQueueDoneness(t *testing.T) {
        gate := make(chan struct{})
        go func() {
                <-gate
-               for _ = range b.NextItem {
+               for range b.NextItem {
                        <-gate
                        time.Sleep(time.Millisecond)
                        b.DoneItem <- struct{}{}