Rename var to avoid shadowing bytes package
importShadow: shadow of imported package 'bytes' (gocritic)
This commit is contained in:
parent
cc98de88ce
commit
3d824b47b7
@ -39,13 +39,13 @@ type LogEntry struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write constructs and writes the final log entry.
|
// Write constructs and writes the final log entry.
|
||||||
func (l *LogEntry) Write(status, bytes int, elapsed time.Duration) {
|
func (l *LogEntry) Write(status, totalBytes int, elapsed time.Duration) {
|
||||||
rid := GetReqID(l.req.Context())
|
rid := GetReqID(l.req.Context())
|
||||||
if rid != "" {
|
if rid != "" {
|
||||||
fmt.Fprintf(l.buf, "[%s] ", rid)
|
fmt.Fprintf(l.buf, "[%s] ", rid)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(l.buf, "%03d | %s | %s | ", status, humanize.IBytes(uint64(bytes)), elapsed)
|
fmt.Fprintf(l.buf, "%03d | %s | %s | ", status, humanize.IBytes(uint64(totalBytes)), elapsed)
|
||||||
l.buf.WriteString(l.req.Host + " | " + l.req.Method + " " + l.req.RequestURI)
|
l.buf.WriteString(l.req.Host + " | " + l.req.Method + " " + l.req.RequestURI)
|
||||||
log.Print(l.buf.String())
|
log.Print(l.buf.String())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user