提交 d619e4ad 作者: Brian Tiger Chow

cancel on exit

上级 35f6ddb8
...@@ -89,7 +89,8 @@ func RandomBytes(n int64) []byte { ...@@ -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{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论