bug fix:并发读写map问题;add:新增Stop()函数
This commit is contained in:
@@ -60,6 +60,7 @@ func NewCatchEth(eth string, sentence string) (*NetCatch, error) {
|
|||||||
nc := new(NetCatch)
|
nc := new(NetCatch)
|
||||||
nc.eth = eth
|
nc.eth = eth
|
||||||
nc.sentence = sentence
|
nc.sentence = sentence
|
||||||
|
nc.ctx, nc.stopFn = context.WithCancel(context.Background())
|
||||||
return nc, nil
|
return nc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user