refactor: no need defer in closeAll
Signed-off-by: Michael Wan <zirenwan@gmail.com>
This commit is contained in:
parent
e1383c3d23
commit
9639db5522
@ -138,10 +138,10 @@ func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *even
|
||||
)
|
||||
|
||||
closeAll := func() {
|
||||
defer close(errq)
|
||||
defer e.broadcaster.Remove(dst)
|
||||
defer queue.Close()
|
||||
defer channel.Close()
|
||||
channel.Close()
|
||||
queue.Close()
|
||||
e.broadcaster.Remove(dst)
|
||||
close(errq)
|
||||
}
|
||||
|
||||
ch = evch
|
||||
|
Loading…
Reference in New Issue
Block a user