🎨 Format of the atomic uint64 call in logfmt middleware

This commit is contained in:
Maxim Lebedev 2024-05-08 19:25:37 +05:00
parent 645daae946
commit 0e610f8880
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5

View File

@ -61,7 +61,7 @@ func LogFmtWithConfig(config LogFmtConfig) Interceptor {
return func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
tx := &logFmtResponse{
id: nextConnID(),
id: atomic.AddUint64(&globalConnID, 1),
responseLength: 0,
ResponseWriter: w,
start: time.Now().UTC(),
@ -126,7 +126,3 @@ func (r *logFmtResponse) Write(src []byte) (int, error) {
return l, r.error
}
func nextConnID() uint64 {
return atomic.AddUint64(&globalConnID, 1)
}