forked from TrueCloudLab/restic
Fix context usage in backend tests
Found by go vet. This is also the only complaint is has.
This commit is contained in:
parent
9790d8ce1c
commit
df66daa5c9
1 changed files with 2 additions and 4 deletions
|
@ -412,13 +412,11 @@ func (s *Suite) TestListCancel(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("Timeout", func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.TODO())
|
||||
defer cancel()
|
||||
|
||||
// rather large timeout, let's try to get at least one item
|
||||
timeout := time.Second
|
||||
|
||||
ctxTimeout, _ := context.WithTimeout(ctx, timeout)
|
||||
ctxTimeout, cancel := context.WithTimeout(context.TODO(), timeout)
|
||||
defer cancel()
|
||||
|
||||
i := 0
|
||||
// pass in a context with a timeout
|
||||
|
|
Loading…
Reference in a new issue