1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 01:52:26 +08:00

cancel on exit

This commit is contained in:
Brian Tiger Chow
2014-12-24 09:26:43 -05:00
parent 35f6ddb8fa
commit d619e4ada9

View File

@ -89,7 +89,8 @@ func RandomBytes(n int64) []byte {
}
func AddCatBytes(data []byte, conf Config) error {
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
mn := mocknet.New(ctx)
// defer mn.Close() FIXME does mocknet require clean-up
mn.SetLinkDefaults(mocknet.LinkOptions{