@@ -80,7 +80,7 @@ func TestReplicatedProgressUpdaterOneReplica(t *testing.T) {
8080 service : service ,
8181 }
8282
83- tasks := []swarm.Task {}
83+ var tasks []swarm.Task //nolint:prealloc // no need to over-complicate things.
8484
8585 ut .testUpdater (tasks , false ,
8686 []progress.Progress {
@@ -193,7 +193,7 @@ func TestReplicatedProgressUpdaterManyReplicas(t *testing.T) {
193193 service : service ,
194194 }
195195
196- tasks := []swarm.Task {}
196+ var tasks []swarm.Task
197197
198198 // No per-task progress bars because there are too many replicas
199199 ut .testUpdater (tasks , false ,
@@ -248,7 +248,7 @@ func TestGlobalProgressUpdaterOneNode(t *testing.T) {
248248 service : service ,
249249 }
250250
251- tasks := []swarm.Task {}
251+ var tasks []swarm.Task //nolint:prealloc // no need to over-complicate things.
252252
253253 ut .testUpdater (tasks , false ,
254254 []progress.Progress {
@@ -362,7 +362,7 @@ func TestGlobalProgressUpdaterManyNodes(t *testing.T) {
362362 ut .activeNodes [strconv .Itoa (i )] = struct {}{}
363363 }
364364
365- tasks := []swarm.Task {}
365+ var tasks []swarm.Task
366366
367367 ut .testUpdater (tasks , false ,
368368 []progress.Progress {
@@ -459,25 +459,24 @@ func TestReplicatedJobProgressUpdaterSmall(t *testing.T) {
459459 })
460460
461461 // wipe the old tasks out of the list
462- tasks = []swarm.Task {}
463- tasks = append (tasks ,
464- swarm.Task {
462+ tasks = []swarm.Task { //nolint:prealloc // no need to over-complicate things.
463+ {
465464 ID : "task1" ,
466465 Slot : 0 ,
467466 NodeID : "" ,
468467 DesiredState : swarm .TaskStateComplete ,
469468 Status : swarm.TaskStatus {State : swarm .TaskStateNew },
470469 JobIteration : & swarm.Version {Index : service .JobStatus .JobIteration .Index },
471470 },
472- swarm. Task {
471+ {
473472 ID : "task2" ,
474473 Slot : 1 ,
475474 NodeID : "" ,
476475 DesiredState : swarm .TaskStateComplete ,
477476 Status : swarm.TaskStatus {State : swarm .TaskStateNew },
478477 JobIteration : & swarm.Version {Index : service .JobStatus .JobIteration .Index },
479478 },
480- )
479+ }
481480 ut .testUpdater (tasks , false , []progress.Progress {
482481 {ID : "1/5" , Action : "new " , Current : 1 , Total : 10 , HideCounts : true },
483482 {ID : "2/5" , Action : "new " , Current : 1 , Total : 10 , HideCounts : true },
@@ -644,7 +643,7 @@ func TestReplicatedJobProgressUpdaterLarge(t *testing.T) {
644643 service : service ,
645644 }
646645
647- tasks := []swarm.Task {}
646+ var tasks []swarm.Task
648647
649648 // see the comments in TestReplicatedJobProgressUpdaterSmall for why
650649 // we write this out twice.
@@ -741,7 +740,7 @@ func TestGlobalJobProgressUpdaterSmall(t *testing.T) {
741740 service : service ,
742741 }
743742
744- tasks := []swarm.Task {
743+ tasks := []swarm.Task { //nolint:prealloc // no need to over-complicate things.
745744 {
746745 ID : "oldtask1" ,
747746 DesiredState : swarm .TaskStateComplete ,
@@ -871,7 +870,7 @@ func TestGlobalJobProgressUpdaterLarge(t *testing.T) {
871870 service : service ,
872871 }
873872
874- tasks := []swarm.Task {}
873+ var tasks []swarm.Task //nolint:prealloc // no need to over-complicate things.
875874 for nodeID := range activeNodes {
876875 tasks = append (tasks , swarm.Task {
877876 ID : "task" + nodeID ,
0 commit comments