🎨 Format of the atomic uint64 call in logfmt middleware
This commit is contained in:
parent
645daae946
commit
0e610f8880
|
@ -61,7 +61,7 @@ func LogFmtWithConfig(config LogFmtConfig) Interceptor {
|
||||||
|
|
||||||
return func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
return func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||||
tx := &logFmtResponse{
|
tx := &logFmtResponse{
|
||||||
id: nextConnID(),
|
id: atomic.AddUint64(&globalConnID, 1),
|
||||||
responseLength: 0,
|
responseLength: 0,
|
||||||
ResponseWriter: w,
|
ResponseWriter: w,
|
||||||
start: time.Now().UTC(),
|
start: time.Now().UTC(),
|
||||||
|
@ -126,7 +126,3 @@ func (r *logFmtResponse) Write(src []byte) (int, error) {
|
||||||
|
|
||||||
return l, r.error
|
return l, r.error
|
||||||
}
|
}
|
||||||
|
|
||||||
func nextConnID() uint64 {
|
|
||||||
return atomic.AddUint64(&globalConnID, 1)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user