Browse code

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>

Sebastiaan van Stijn authored on 2022/01/20 22:21:56
Showing 2 changed files
... ...
@@ -57,7 +57,7 @@ func New(info logger.Info) (logger.Logger, error) {
57 57
 			return nil, fmt.Errorf("max-size must be a positive number")
58 58
 		}
59 59
 	}
60
-	var maxFiles = 1
60
+	maxFiles := 1
61 61
 	if maxFileString, ok := info.Config["max-file"]; ok {
62 62
 		var err error
63 63
 		maxFiles, err = strconv.Atoi(maxFileString)
... ...
@@ -104,7 +104,7 @@ func New(info logger.Info) (logger.Logger, error) {
104 104
 		}
105 105
 	}
106 106
 
107
-	writer, err := loggerutils.NewLogFile(info.LogPath, capval, maxFiles, compress, decodeFunc, 0640, getTailReader)
107
+	writer, err := loggerutils.NewLogFile(info.LogPath, capval, maxFiles, compress, decodeFunc, 0o640, getTailReader)
108 108
 	if err != nil {
109 109
 		return nil, err
110 110
 	}
... ...
@@ -20,7 +20,7 @@ type JSONLogs struct {
20 20
 // MarshalJSONBuf is an optimized JSON marshaller that avoids reflection
21 21
 // and unnecessary allocation.
22 22
 func (mj *JSONLogs) MarshalJSONBuf(buf *bytes.Buffer) error {
23
-	var first = true
23
+	first := true
24 24
 
25 25
 	buf.WriteString(`{`)
26 26
 	if len(mj.Log) != 0 {