fix: err is shadowed in server main function

Signed-off-by: Shuoran Liu <shuoranliu@gmail.com>
This commit is contained in:
Shuoran Liu 2019-09-04 11:48:11 +08:00 committed by awzhgw
parent c06e1dbaf7
commit 8ce0f64ad0

View File

@ -223,8 +223,8 @@ func main() {
if profPort != "" {
go func() {
http.HandleFunc(log.SetLogLevelPath, log.SetLogLevel)
err = http.ListenAndServe(fmt.Sprintf(":%v", profPort), nil)
if err != nil {
e := http.ListenAndServe(fmt.Sprintf(":%v", profPort), nil)
if e != nil {
daemonize.SignalOutcome(fmt.Errorf("cannot listen pprof %v err %v", profPort, err))
os.Exit(1)
}