daemon/logger/loggerutils: format code with gofumpt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
011a32a4ad
commit
48124bac18
5 changed files with 7 additions and 7 deletions
|
@ -20,7 +20,7 @@ func TestOpenFileDelete(t *testing.T) {
|
|||
|
||||
func TestOpenFileRename(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
f, err := openFile(filepath.Join(tmpDir, "test.txt"), os.O_CREATE|os.O_RDWR, 0644)
|
||||
f, err := openFile(filepath.Join(tmpDir, "test.txt"), os.O_CREATE|os.O_RDWR, 0o644)
|
||||
assert.NilError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
|
@ -30,7 +30,7 @@ func TestOpenFileRename(t *testing.T) {
|
|||
func TestUnlinkOpenFile(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
name := filepath.Join(tmpDir, "test.txt")
|
||||
f, err := openFile(name, os.O_CREATE|os.O_RDWR, 0644)
|
||||
f, err := openFile(name, os.O_CREATE|os.O_RDWR, 0o644)
|
||||
assert.NilError(t, err)
|
||||
defer func() { assert.NilError(t, f.Close()) }()
|
||||
|
||||
|
@ -38,7 +38,7 @@ func TestUnlinkOpenFile(t *testing.T) {
|
|||
assert.NilError(t, err)
|
||||
|
||||
assert.NilError(t, unlink(name))
|
||||
f2, err := openFile(name, os.O_CREATE|os.O_RDWR, 0644)
|
||||
f2, err := openFile(name, os.O_CREATE|os.O_RDWR, 0o644)
|
||||
assert.NilError(t, err)
|
||||
defer func() { assert.NilError(t, f2.Close()) }()
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ func compressFile(fileName string, lastTimestamp time.Time) (retErr error) {
|
|||
}
|
||||
}()
|
||||
|
||||
outFile, err := openFile(fileName+".gz", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0640)
|
||||
outFile, err := openFile(fileName+".gz", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0o640)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to open or create gzip log file")
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ func TestConcurrentLogging(t *testing.T) {
|
|||
ct := ct
|
||||
dir := t.TempDir()
|
||||
g.Go(func() (err error) {
|
||||
logfile, err := NewLogFile(filepath.Join(dir, "log.log"), capacity, maxFiles, compress, createDecoder, 0644, getTailReader)
|
||||
logfile, err := NewLogFile(filepath.Join(dir, "log.log"), capacity, maxFiles, compress, createDecoder, 0o644, getTailReader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ func TestCheckCapacityAndRotate(t *testing.T) {
|
|||
3, // maxFiles
|
||||
true, // compress
|
||||
createDecoder,
|
||||
0600, // perms
|
||||
0o600, // perms
|
||||
getTailReader,
|
||||
)
|
||||
assert.NilError(t, err)
|
||||
|
|
|
@ -212,7 +212,7 @@ func TestSharedTempFileConverter(t *testing.T) {
|
|||
|
||||
func createFile(t *testing.T, path string, content string) {
|
||||
t.Helper()
|
||||
f, err := openFile(path, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0644)
|
||||
f, err := openFile(path, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o644)
|
||||
assert.NilError(t, err)
|
||||
_, err = io.WriteString(f, content)
|
||||
assert.NilError(t, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue