mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
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
@ -412,13 +412,11 @@ func (s *Suite) TestListCancel(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Timeout", func(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
|
// rather large timeout, let's try to get at least one item
|
||||||
timeout := time.Second
|
timeout := time.Second
|
||||||
|
|
||||||
ctxTimeout, _ := context.WithTimeout(ctx, timeout)
|
ctxTimeout, cancel := context.WithTimeout(context.TODO(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
i := 0
|
i := 0
|
||||||
// pass in a context with a timeout
|
// pass in a context with a timeout
|
||||||
|
Loading…
Reference in New Issue
Block a user