summaryrefslogtreecommitdiffstats
path: root/modules/web/routing
diff options
context:
space:
mode:
Diffstat (limited to 'modules/web/routing')
-rw-r--r--modules/web/routing/context.go5
-rw-r--r--modules/web/routing/funcinfo.go8
-rw-r--r--modules/web/routing/logger_manager.go6
3 files changed, 10 insertions, 9 deletions
diff --git a/modules/web/routing/context.go b/modules/web/routing/context.go
index f57b2e9026..d3c7759e64 100644
--- a/modules/web/routing/context.go
+++ b/modules/web/routing/context.go
@@ -13,7 +13,7 @@ type contextKeyType struct{}
var contextKey contextKeyType
-//UpdateFuncInfo updates a context's func info
+// UpdateFuncInfo updates a context's func info
func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
record, ok := ctx.Value(contextKey).(*requestRecord)
if !ok {
@@ -23,7 +23,6 @@ func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
record.lock.Lock()
record.funcInfo = funcInfo
record.lock.Unlock()
-
}
// MarkLongPolling marks the reuqest is a long-polling request, and the logger may output different message for it
@@ -38,7 +37,7 @@ func MarkLongPolling(resp http.ResponseWriter, req *http.Request) {
record.lock.Unlock()
}
-//UpdatePanicError updates a context's error info, a panic may be recovered by other middlewares, but we still need to know that.
+// UpdatePanicError updates a context's error info, a panic may be recovered by other middlewares, but we still need to know that.
func UpdatePanicError(ctx context.Context, err interface{}) {
record, ok := ctx.Value(contextKey).(*requestRecord)
if !ok {
diff --git a/modules/web/routing/funcinfo.go b/modules/web/routing/funcinfo.go
index 6d3986e364..9bb38af1c8 100644
--- a/modules/web/routing/funcinfo.go
+++ b/modules/web/routing/funcinfo.go
@@ -12,9 +12,11 @@ import (
"sync"
)
-var funcInfoMap = map[uintptr]*FuncInfo{}
-var funcInfoNameMap = map[string]*FuncInfo{}
-var funcInfoMapMu sync.RWMutex
+var (
+ funcInfoMap = map[uintptr]*FuncInfo{}
+ funcInfoNameMap = map[string]*FuncInfo{}
+ funcInfoMapMu sync.RWMutex
+)
// FuncInfo contains information about the function to be logged by the router log
type FuncInfo struct {
diff --git a/modules/web/routing/logger_manager.go b/modules/web/routing/logger_manager.go
index 31fd09f312..cc434c338d 100644
--- a/modules/web/routing/logger_manager.go
+++ b/modules/web/routing/logger_manager.go
@@ -17,13 +17,13 @@ import (
type Event int
const (
- //StartEvent at the beginning of a request
+ // StartEvent at the beginning of a request
StartEvent Event = iota
- //StillExecutingEvent the request is still executing
+ // StillExecutingEvent the request is still executing
StillExecutingEvent
- //EndEvent the request has ended (either completed or failed)
+ // EndEvent the request has ended (either completed or failed)
EndEvent
)