@@ -78,7 +78,7 @@ func TestFilterAvailableUpdates(t *testing.T) {
7878 StandardOutputContent : aws .String (responses [* input .InstanceId ]),
7979 }, nil
8080 },
81- SendCommandFn : func (input * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
81+ SendCommandFn : func (_ * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
8282 sendCommandCalls ++
8383 return & ssm.SendCommandOutput {
8484 Command : & ssm.Command {
@@ -87,7 +87,7 @@ func TestFilterAvailableUpdates(t *testing.T) {
8787 },
8888 }, nil
8989 },
90- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
90+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
9191 m .Lock ()
9292 commandWaiterCalls ++
9393 m .Unlock ()
@@ -134,11 +134,11 @@ func TestPaginatedFilterAvailableUpdatesSuccess(t *testing.T) {
134134 commandWaiterCalls := 0
135135 getCommandInvocationCalls := 0
136136 mockSSM := MockSSM {
137- GetCommandInvocationFn : func (input * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
137+ GetCommandInvocationFn : func (_ * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
138138 getCommandInvocationCalls ++
139139 return getOut , nil
140140 },
141- SendCommandFn : func (input * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
141+ SendCommandFn : func (_ * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
142142 sendCommandCalls ++
143143 return & ssm.SendCommandOutput {
144144 Command : & ssm.Command {
@@ -147,7 +147,7 @@ func TestPaginatedFilterAvailableUpdatesSuccess(t *testing.T) {
147147 },
148148 }, nil
149149 },
150- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
150+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
151151 m .Lock ()
152152 commandWaiterCalls ++
153153 m .Unlock ()
@@ -178,7 +178,7 @@ func TestPaginatedFilterAvailableUpdatesAllFail(t *testing.T) {
178178
179179 sendCommandCalls := 0
180180 mockSSM := MockSSM {
181- SendCommandFn : func (input * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
181+ SendCommandFn : func (_ * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
182182 sendCommandCalls ++
183183 return nil , errors .New ("Failed to send document" )
184184 },
@@ -211,7 +211,7 @@ func TestPaginatedFilterAvailableUpdatesInPageFailures(t *testing.T) {
211211 getCommandInvocationCalls := 0
212212 count := 0
213213 mockSSM := MockSSM {
214- GetCommandInvocationFn : func (input * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
214+ GetCommandInvocationFn : func (_ * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
215215 count ++
216216 getCommandInvocationCalls ++
217217 switch count % 3 {
@@ -230,7 +230,7 @@ func TestPaginatedFilterAvailableUpdatesInPageFailures(t *testing.T) {
230230 }
231231 return nil , nil
232232 },
233- SendCommandFn : func (input * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
233+ SendCommandFn : func (_ * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
234234 sendCommandCalls ++
235235 return & ssm.SendCommandOutput {
236236 Command : & ssm.Command {
@@ -239,7 +239,7 @@ func TestPaginatedFilterAvailableUpdatesInPageFailures(t *testing.T) {
239239 },
240240 }, nil
241241 },
242- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
242+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
243243 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
244244 m .Lock ()
245245 commandWaiterCalls ++
@@ -289,11 +289,11 @@ func TestPaginatedFilterAvailableUpdatesSingleErr(t *testing.T) {
289289 getCommandInvocationCalls := 0
290290 callCount := 0
291291 mockSSM := MockSSM {
292- GetCommandInvocationFn : func (input * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
292+ GetCommandInvocationFn : func (_ * ssm.GetCommandInvocationInput ) (* ssm.GetCommandInvocationOutput , error ) {
293293 getCommandInvocationCalls ++
294294 return getOut , nil
295295 },
296- SendCommandFn : func (input * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
296+ SendCommandFn : func (_ * ssm.SendCommandInput ) (* ssm.SendCommandOutput , error ) {
297297 require .Less (t , callCount , len (pageErrors ))
298298 failErr := pageErrors [callCount ]
299299 callCount ++
@@ -305,7 +305,7 @@ func TestPaginatedFilterAvailableUpdatesSingleErr(t *testing.T) {
305305 },
306306 }, failErr
307307 },
308- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
308+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
309309 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
310310 m .Lock ()
311311 commandWaiterCalls ++
@@ -391,7 +391,7 @@ func TestSendCommandSuccess(t *testing.T) {
391391 assert .Equal (t , aws .StringSlice (instances ), input .InstanceIds )
392392 return & ssm.SendCommandOutput {Command : & ssm.Command {CommandId : aws .String ("command-id" )}}, nil
393393 },
394- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
394+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
395395 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
396396 m .Lock ()
397397 waitInstanceIDs = append (waitInstanceIDs , aws .StringValue (input .InstanceId ))
@@ -451,7 +451,7 @@ func TestSendCommandWaitErr(t *testing.T) {
451451 Command : & ssm.Command {CommandId : aws .String ("command-id" )},
452452 }, nil
453453 },
454- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
454+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
455455 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
456456 return waitError
457457 },
@@ -486,7 +486,7 @@ func TestSendCommandWaitSuccess(t *testing.T) {
486486 failedInstanceIDs := []string {}
487487 mockSSM := MockSSM {
488488 SendCommandFn : mockSendCommand ,
489- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
489+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
490490 if aws .StringValue (input .InstanceId ) == commandSuccessInstance {
491491 return nil
492492 }
@@ -512,7 +512,7 @@ func TestSendCommandWaitSuccess(t *testing.T) {
512512 waitInstanceIDs := []string {}
513513 mockSSM := MockSSM {
514514 SendCommandFn : mockSendCommand ,
515- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
515+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
516516 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
517517 m .Lock ()
518518 waitInstanceIDs = append (waitInstanceIDs , aws .StringValue (input .InstanceId ))
@@ -1040,7 +1040,7 @@ func TestDrainInstance(t *testing.T) {
10401040 mockECS := MockECS {
10411041 UpdateContainerInstancesStateFn : mockStateChange ,
10421042 ListTasksFn : mockListTasks ,
1043- WaitUntilTasksStoppedWithContextFn : func (ctx aws.Context , input * ecs.DescribeTasksInput , opts ... request.WaiterOption ) error {
1043+ WaitUntilTasksStoppedWithContextFn : func (_ aws.Context , input * ecs.DescribeTasksInput , _ ... request.WaiterOption ) error {
10441044 assert .Equal (t , []* string {
10451045 aws .String ("task-arn-1" ),
10461046 }, input .Tasks )
@@ -1120,7 +1120,7 @@ func TestDrainInstance(t *testing.T) {
11201120 mockECS := MockECS {
11211121 UpdateContainerInstancesStateFn : mockStateChange ,
11221122 ListTasksFn : mockListTasks ,
1123- WaitUntilTasksStoppedWithContextFn : func (ctx aws.Context , input * ecs.DescribeTasksInput , opts ... request.WaiterOption ) error {
1123+ WaitUntilTasksStoppedWithContextFn : func (_ aws.Context , input * ecs.DescribeTasksInput , _ ... request.WaiterOption ) error {
11241124 assert .Equal (t , []* string {
11251125 aws .String ("task-arn-1" ),
11261126 }, input .Tasks )
@@ -1193,7 +1193,7 @@ func TestUpdateInstance(t *testing.T) {
11931193 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
11941194 return tc .invocationOut , nil
11951195 },
1196- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1196+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
11971197 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
11981198 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
11991199 return nil
@@ -1240,7 +1240,7 @@ func TestUpdateInstanceErr(t *testing.T) {
12401240 StandardOutputContent : aws .String ("{\" update_state\" : \" Available\" , \" active_partition\" : { \" image\" : { \" version\" : \" 0.0.0\" }}}" ),
12411241 }, nil
12421242 }
1243- mockWaitCommandExecution := func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1243+ mockWaitCommandExecution := func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
12441244 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
12451245 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
12461246 return nil
@@ -1328,7 +1328,7 @@ func TestUpdateInstanceErr(t *testing.T) {
13281328 waitExecErr := errors .New ("failed to wait ssm execution complete" )
13291329 mockSSM := MockSSM {
13301330 SendCommandFn : mockSendCommand ,
1331- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1331+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
13321332 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
13331333 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
13341334 return waitExecErr
@@ -1420,7 +1420,7 @@ func TestVerifyUpdate(t *testing.T) {
14201420 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
14211421 return tc .invocationOut , nil
14221422 },
1423- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1423+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
14241424 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
14251425 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
14261426 return nil
@@ -1449,7 +1449,7 @@ func TestVerifyUpdateErr(t *testing.T) {
14491449 },
14501450 }, nil
14511451 }
1452- mockWaitCommandExecution := func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1452+ mockWaitCommandExecution := func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
14531453 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
14541454 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
14551455 return nil
@@ -1485,7 +1485,7 @@ func TestVerifyUpdateErr(t *testing.T) {
14851485 waitExecErr := errors .New ("failed to wait ssm execution complete" )
14861486 mockSSM := MockSSM {
14871487 SendCommandFn : mockSSMCommandOut ,
1488- WaitUntilCommandExecutedWithContextFn : func (ctx aws.Context , input * ssm.GetCommandInvocationInput , opts ... request.WaiterOption ) error {
1488+ WaitUntilCommandExecutedWithContextFn : func (_ aws.Context , input * ssm.GetCommandInvocationInput , _ ... request.WaiterOption ) error {
14891489 assert .Equal (t , "command-id" , aws .StringValue (input .CommandId ))
14901490 assert .Equal (t , "instance-id" , aws .StringValue (input .InstanceId ))
14911491 return waitExecErr
@@ -1586,7 +1586,7 @@ func TestActivateInstance(t *testing.T) {
15861586 for _ , tc := range cases {
15871587 t .Run (tc .name , func (t * testing.T ) {
15881588 mockECS := MockECS {
1589- UpdateContainerInstancesStateFn : func (input * ecs.UpdateContainerInstancesStateInput ) (* ecs.UpdateContainerInstancesStateOutput , error ) {
1589+ UpdateContainerInstancesStateFn : func (_ * ecs.UpdateContainerInstancesStateInput ) (* ecs.UpdateContainerInstancesStateOutput , error ) {
15901590 return tc .stateOut , tc .stateErr
15911591 },
15921592 }
@@ -1639,7 +1639,7 @@ func TestAlreadyRunning(t *testing.T) {
16391639 for _ , tc := range cases {
16401640 t .Run (tc .name , func (t * testing.T ) {
16411641 mockECS := MockECS {
1642- ListTasksFn : func (input * ecs.ListTasksInput ) (* ecs.ListTasksOutput , error ) {
1642+ ListTasksFn : func (_ * ecs.ListTasksInput ) (* ecs.ListTasksOutput , error ) {
16431643 return tc .listOut , tc .listErr
16441644 },
16451645 }
0 commit comments