daemon/logger/jsonfilelog: format code with gofumpt

Formatting the code with https://github.com/mvdan/gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-01-20 14:21:56 +01:00
parent 1437037ed2
commit bb5a1eb99d
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 3 additions and 3 deletions

View file

@ -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
}

View file

@ -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 {