Skip to content

Commit 94f668e

Browse files
committed
refactor: avoid unnecessary select
1 parent 49670fd commit 94f668e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

canal/canal.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ func Main() error {
107107
sigChan := make(chan os.Signal, 1)
108108
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
109109

110-
select {
111-
case <-sys.HandleSignal():
112-
logger.Info("receive signal, shutdown")
113-
return fmt.Errorf("receive signal")
114-
}
110+
s := <-sys.HandleSignal()
111+
logger.Info("receive signal, shutdown")
112+
return fmt.Errorf("receive signal %s", s)
115113
})
116114

117115
return wg.Wait()

0 commit comments

Comments
 (0)