From ce01d779df332b8bb26aab7e7ae34a569a93dba7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Aug 2023 17:59:22 +0200 Subject: [PATCH] daemon: format code with gofumpt Signed-off-by: Sebastiaan van Stijn --- daemon/config/config_test.go | 2 +- daemon/runtime_unix.go | 4 ++-- daemon/snapshotter/mount.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daemon/config/config_test.go b/daemon/config/config_test.go index 52b60241fe..e85e988c46 100644 --- a/daemon/config/config_test.go +++ b/daemon/config/config_test.go @@ -23,7 +23,7 @@ import ( func makeConfigFile(t *testing.T, content string) string { t.Helper() name := filepath.Join(t.TempDir(), "daemon.json") - err := os.WriteFile(name, []byte(content), 0666) + err := os.WriteFile(name, []byte(content), 0o666) assert.NilError(t, err) return name } diff --git a/daemon/runtime_unix.go b/daemon/runtime_unix.go index ca521debb9..f4fff8da5f 100644 --- a/daemon/runtime_unix.go +++ b/daemon/runtime_unix.go @@ -95,7 +95,7 @@ func initRuntimesDir(cfg *config.Config) error { if err := os.RemoveAll(runtimeDir); err != nil { return err } - return system.MkdirAll(runtimeDir, 0700) + return system.MkdirAll(runtimeDir, 0o700) } func setupRuntimes(cfg *config.Config) (runtimes, error) { @@ -193,7 +193,7 @@ func wrapRuntime(dir, name, binary string, args []string) (string, error) { // containers. suffix := base32Disemvoweled.EncodeToString(sum.Sum(nil)) scriptPath := filepath.Join(dir, name+"."+suffix) - if err := ioutils.AtomicWriteFile(scriptPath, wrapper.Bytes(), 0700); err != nil { + if err := ioutils.AtomicWriteFile(scriptPath, wrapper.Bytes(), 0o700); err != nil { return "", err } return scriptPath, nil diff --git a/daemon/snapshotter/mount.go b/daemon/snapshotter/mount.go index b7c28a2865..f809b34f0f 100644 --- a/daemon/snapshotter/mount.go +++ b/daemon/snapshotter/mount.go @@ -93,7 +93,7 @@ func (m *refCountMounter) Mount(mounts []mount.Mount, containerID string) (targe }() root := m.idMap.RootPair() - if err := idtools.MkdirAllAndChown(target, 0700, root); err != nil { + if err := idtools.MkdirAllAndChown(target, 0o700, root); err != nil { return "", err } @@ -129,7 +129,7 @@ func (m mounter) Mount(mounts []mount.Mount, containerID string) (string, error) target := filepath.Join(m.home, mountsDir, m.snapshotter, containerID) root := m.idMap.RootPair() - if err := idtools.MkdirAndChown(target, 0700, root); err != nil { + if err := idtools.MkdirAndChown(target, 0o700, root); err != nil { return "", err }