Skip to content

Commit

Permalink
Use context.TODO() in example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guseggert committed Dec 2, 2021
1 parent ade1af0 commit adf6d8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v2/blockstore/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ExampleOpenReadOnly() {
fmt.Printf("\t%v\n", r)
}

ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(context.TODO())
defer cancel()

// Print the raw data size for the first 5 CIDs in the CAR file.
Expand Down
2 changes: 1 addition & 1 deletion v2/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func ExampleWrapV1File() {
if err != nil {
panic(err)
}
fmt.Println(bs.Get(context.Background(), roots[0]))
fmt.Println(bs.Get(context.TODO(), roots[0]))

// Output:
// Roots: [bafy2bzaced4ueelaegfs5fqu4tzsh6ywbbpfk3cxppupmxfdhbpbhzawfw5oy]
Expand Down

0 comments on commit adf6d8a

Please sign in to comment.