@cryptotaxi247 / kubo / commits / 22a15259e

fix(example): cancel context

Steven Allen committed Nov 15, 2019 at 20:11 UTC 22a15259e76445b0b994e129f7a15315d05780ec
1 file changed +2 -1
docs/examples/go-ipfs-as-a-library/main.go
+2 -1
@@ -204,7 +204,8 @@ func main() {
204
205 fmt.Println("-- Getting an IPFS node running -- ")
206
207 - ctx, _ := context.WithCancel(context.Background())
207 + ctx, cancel := context.WithCancel(context.Background())
208 + defer cancel()
209
210 /*
211 // Spawn a node using the default path (~/.ipfs), assuming that a repo exists there already