mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-12 08:34:43 +00:00
Rename var to avoid shadowing bytes package
importShadow: shadow of imported package 'bytes' (gocritic)
This commit is contained in:
parent
cc98de88ce
commit
3d824b47b7
1 changed files with 2 additions and 2 deletions
|
@ -39,13 +39,13 @@ type LogEntry struct {
|
|||
}
|
||||
|
||||
// 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())
|
||||
if 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)
|
||||
log.Print(l.buf.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue