From bb5a1eb99d48ae4836ad37f79b307f8fce13b42b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 20 Jan 2022 14:21:56 +0100 Subject: [PATCH] daemon/logger/jsonfilelog: format code with gofumpt Formatting the code with https://github.com/mvdan/gofumpt Signed-off-by: Sebastiaan van Stijn --- daemon/logger/jsonfilelog/jsonfilelog.go | 4 ++-- daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/logger/jsonfilelog/jsonfilelog.go b/daemon/logger/jsonfilelog/jsonfilelog.go index ce861bdd8a..e3e2490a29 100644 --- a/daemon/logger/jsonfilelog/jsonfilelog.go +++ b/daemon/logger/jsonfilelog/jsonfilelog.go @@ -57,7 +57,7 @@ func New(info logger.Info) (logger.Logger, error) { return nil, fmt.Errorf("max-size must be a positive number") } } - var maxFiles = 1 + maxFiles := 1 if maxFileString, ok := info.Config["max-file"]; ok { var err error maxFiles, err = strconv.Atoi(maxFileString) @@ -104,7 +104,7 @@ func New(info logger.Info) (logger.Logger, error) { } } - writer, err := loggerutils.NewLogFile(info.LogPath, capval, maxFiles, compress, decodeFunc, 0640, getTailReader) + writer, err := loggerutils.NewLogFile(info.LogPath, capval, maxFiles, compress, decodeFunc, 0o640, getTailReader) if err != nil { return nil, err } diff --git a/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go b/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go index 577c718f63..d7e2e37184 100644 --- a/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go +++ b/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go @@ -20,7 +20,7 @@ type JSONLogs struct { // MarshalJSONBuf is an optimized JSON marshaller that avoids reflection // and unnecessary allocation. func (mj *JSONLogs) MarshalJSONBuf(buf *bytes.Buffer) error { - var first = true + first := true buf.WriteString(`{`) if len(mj.Log) != 0 {