Merge pull request #3 from berlin2123/patch-2-gofmt

Patch 2 gofmt
This commit is contained in:
berlin2123 2022-10-13 10:17:43 +08:00 committed by GitHub
commit e55453bb66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 23 deletions

View File

@ -302,21 +302,21 @@ func HandleUserTCPConnection(pxy Proxy, userConn net.Conn, serverCfg config.Serv
if IsTheTypeToLog(serverCfg.LogDurationTypes, name) {
endtime := time.Now().UnixNano() / 1000000 // time in microseconds
connection_duration := endtime - startime
xl.Debug("join connection closed, it remains [%d]ms, workConn(l[%s] r[%s]) userConn(l[%s] r[%s])", connection_duration,
connectionDuration := endtime - startime
xl.Debug("join connection closed, it remains [%d]ms, workConn(l[%s] r[%s]) userConn(l[%s] r[%s])", connectionDuration,
workConn.LocalAddr().String(), workConn.RemoteAddr().String(), userConn.LocalAddr().String(), userConn.RemoteAddr().String())
xl.Info("connection closed, it remains [%d]ms, userConn(l[%s] r[%s])", connection_duration,
xl.Info("connection closed, it remains [%d]ms, userConn(l[%s] r[%s])", connectionDuration,
userConn.LocalAddr().String(), userConn.RemoteAddr().String())
} else {
xl.Debug("join connection closed, userConn(l[%s] r[%s])", userConn.LocalAddr().String(), userConn.RemoteAddr().String())
}
}
func IsTheTypeToLog(LogDurationTypes string, name string) bool {
if strings.Contains(LogDurationTypes, "all") {
func IsTheTypeToLog(logDurationTypes string, name string) bool {
if strings.Contains(logDurationTypes, "all") {
return true
}
thestrlist := strings.Split(LogDurationTypes, ",")
thestrlist := strings.Split(logDurationTypes, ",")
for i := 0; i < len(thestrlist); i++ {
if strings.Contains(name, thestrlist[i]) {
return true