From bbab3fe9cab1d8023841f209bd03bc41e1850979 Mon Sep 17 00:00:00 2001 From: fatedier Date: Thu, 31 Jan 2019 16:54:46 +0800 Subject: [PATCH] go lint --- utils/log/log.go | 5 ++++- utils/net/websocket.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/log/log.go b/utils/log/log.go index a0e42b8f..c0ce7f12 100644 --- a/utils/log/log.go +++ b/utils/log/log.go @@ -20,6 +20,7 @@ import ( "github.com/fatedier/beego/logs" ) +// Log is the under log object var Log *logs.BeeLogger func init() { @@ -33,6 +34,7 @@ func InitLog(logWay string, logFile string, logLevel string, maxdays int64) { SetLogLevel(logLevel) } +// SetLogFile to configure log params // logWay: file or console func SetLogFile(logWay string, logFile string, maxdays int64) { if logWay == "console" { @@ -43,6 +45,7 @@ func SetLogFile(logWay string, logFile string, maxdays int64) { } } +// SetLogLevel set log level, default is warning // value: error, warning, info, debug, trace func SetLogLevel(logLevel string) { level := 4 // warning @@ -85,7 +88,7 @@ func Trace(format string, v ...interface{}) { Log.Trace(format, v...) } -// Logger +// Logger is the log interface type Logger interface { AddLogPrefix(string) GetPrefixStr() string diff --git a/utils/net/websocket.go b/utils/net/websocket.go index 8ecc17e1..99423373 100644 --- a/utils/net/websocket.go +++ b/utils/net/websocket.go @@ -31,6 +31,7 @@ type WebsocketListener struct { httpMutex *http.ServeMux } +// NewWebsocketListener to handle websocket connections // ln: tcp listener for websocket connections func NewWebsocketListener(ln net.Listener) (wl *WebsocketListener) { wl = &WebsocketListener{