import error message

This commit is contained in:
2020-02-23 23:59:37 +08:00
parent e98f06290f
commit a4b52c59cc

View File

@@ -47,7 +47,7 @@ func main() {
return return
} }
if len(tcpListenConfig.TcpListens) == 0 { if len(tcpListenConfig.TcpListens) == 0 {
fmt.Println("[ERROR] Not find any mapping in config") fmt.Printf("[ERROR] Not find any mapping in config\n")
printHelpMessage() printHelpMessage()
return return
} }
@@ -62,7 +62,7 @@ func main() {
func serverTcpListen(tcpListen TcpListen) { func serverTcpListen(tcpListen TcpListen) {
lis, err := net.Listen("tcp", tcpListen.Listen) lis, err := net.Listen("tcp", tcpListen.Listen)
if err != nil { if err != nil {
fmt.Println(err) fmt.Printf("[ERROR] Listen on port %s error: %s\n", tcpListen.Listen, err)
return return
} }
defer lis.Close() defer lis.Close()