mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 02:30:39 +08:00
cancel on exit
This commit is contained in:
@ -89,7 +89,8 @@ func RandomBytes(n int64) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddCatBytes(data []byte, conf Config) error {
|
func AddCatBytes(data []byte, conf Config) error {
|
||||||
ctx := context.Background()
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
defer cancel()
|
||||||
mn := mocknet.New(ctx)
|
mn := mocknet.New(ctx)
|
||||||
// defer mn.Close() FIXME does mocknet require clean-up
|
// defer mn.Close() FIXME does mocknet require clean-up
|
||||||
mn.SetLinkDefaults(mocknet.LinkOptions{
|
mn.SetLinkDefaults(mocknet.LinkOptions{
|
||||||
|
Reference in New Issue
Block a user