@@ -15,7 +15,7 @@ func (suite *UnitTestSuite) TestRetryer() {
1515
1616 suite .Run ("with a function that immediately succeeds" , func () {
1717 attemptNumber := - 1
18- f := func (ri * Info ) error {
18+ f := func (_ context. Context , ri * Info ) error {
1919 attemptNumber = ri .GetAttemptNumber ()
2020 return nil
2121 }
@@ -24,7 +24,7 @@ func (suite *UnitTestSuite) TestRetryer() {
2424 suite .NoError (err )
2525 suite .Equal (0 , attemptNumber )
2626
27- f2 := func (ri * Info ) error {
27+ f2 := func (_ context. Context , ri * Info ) error {
2828 attemptNumber = ri .GetAttemptNumber ()
2929 return nil
3030 }
@@ -36,7 +36,7 @@ func (suite *UnitTestSuite) TestRetryer() {
3636
3737 suite .Run ("with a function that succeeds after two attempts" , func () {
3838 attemptNumber := - 1
39- f := func (ri * Info ) error {
39+ f := func (_ context. Context , ri * Info ) error {
4040 attemptNumber = ri .GetAttemptNumber ()
4141 if attemptNumber < 2 {
4242 return mongo.CommandError {
@@ -52,7 +52,7 @@ func (suite *UnitTestSuite) TestRetryer() {
5252 suite .Equal (2 , attemptNumber )
5353
5454 attemptNumber = - 1
55- f2 := func (ri * Info ) error {
55+ f2 := func (_ context. Context , ri * Info ) error {
5656 attemptNumber = ri .GetAttemptNumber ()
5757 if attemptNumber < 2 {
5858 return mongo.CommandError {
@@ -77,7 +77,7 @@ func (suite *UnitTestSuite) TestRetryerDurationLimitIsZero() {
7777 Labels : []string {"NetworkError" },
7878 Name : "NetworkError" ,
7979 }
80- f := func (ri * Info ) error {
80+ f := func (_ context. Context , ri * Info ) error {
8181 attemptNumber = ri .attemptNumber
8282 return cmdErr
8383 }
@@ -103,7 +103,7 @@ func (suite *UnitTestSuite) TestRetryerDurationReset() {
103103 // 1) Not calling IterationSuccess() means f will not be retried, since the
104104 // durationLimit is exceeded
105105 noSuccessIterations := 0
106- f1 := func (ri * Info ) error {
106+ f1 := func (_ context. Context , ri * Info ) error {
107107 // Artificially advance how much time was taken.
108108 ri .lastResetTime = ri .lastResetTime .Add (- 2 * ri .durationLimit )
109109
@@ -126,7 +126,7 @@ func (suite *UnitTestSuite) TestRetryerDurationReset() {
126126 // 2) Calling IterationSuccess() means f will run more than once because the
127127 // duration should be reset.
128128 successIterations := 0
129- f2 := func (ri * Info ) error {
129+ f2 := func (_ context. Context , ri * Info ) error {
130130 // Artificially advance how much time was taken.
131131 ri .lastResetTime = ri .lastResetTime .Add (- 2 * ri .durationLimit )
132132
@@ -152,7 +152,7 @@ func (suite *UnitTestSuite) TestCancelViaContext() {
152152 counter := 0
153153 var wg sync.WaitGroup
154154 wg .Add (1 )
155- f := func (_ * Info ) error {
155+ f := func (_ context. Context , _ * Info ) error {
156156 counter ++
157157 if counter == 1 {
158158 return errors .New ("not master" )
@@ -184,7 +184,7 @@ func (suite *UnitTestSuite) TestRetryerAdditionalErrorCodes() {
184184 }
185185
186186 var attemptNumber int
187- f := func (ri * Info ) error {
187+ f := func (_ context. Context , ri * Info ) error {
188188 attemptNumber = ri .GetAttemptNumber ()
189189 if attemptNumber == 0 {
190190 return customError
0 commit comments