From 8a3484b736a09bec19ca6e665d28c91d00ae8766 Mon Sep 17 00:00:00 2001 From: Kenta Tada Date: Tue, 2 Mar 2021 16:26:36 +0900 Subject: [PATCH] libcontainer/factory*: adjust the file mode This commit adjusts the file mode to use the latest golang style Related to #2625 Signed-off-by: Kenta Tada --- libcontainer/factory_linux.go | 4 ++-- libcontainer/factory_linux_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libcontainer/factory_linux.go b/libcontainer/factory_linux.go index b181d08d08a..0b4cf59eb19 100644 --- a/libcontainer/factory_linux.go +++ b/libcontainer/factory_linux.go @@ -185,7 +185,7 @@ func CriuPath(criupath string) func(*LinuxFactory) error { // configures the factory with the provided option funcs. func New(root string, options ...func(*LinuxFactory) error) (Factory, error) { if root != "" { - if err := os.MkdirAll(root, 0700); err != nil { + if err := os.MkdirAll(root, 0o700); err != nil { return nil, newGenericError(err, SystemError) } } @@ -259,7 +259,7 @@ func (l *LinuxFactory) Create(id string, config *configs.Config) (Container, err } else if !os.IsNotExist(err) { return nil, newGenericError(err, SystemError) } - if err := os.MkdirAll(containerRoot, 0711); err != nil { + if err := os.MkdirAll(containerRoot, 0o711); err != nil { return nil, newGenericError(err, SystemError) } if err := os.Chown(containerRoot, unix.Geteuid(), unix.Getegid()); err != nil { diff --git a/libcontainer/factory_linux_test.go b/libcontainer/factory_linux_test.go index 2b40e24dea1..665a8a7c446 100644 --- a/libcontainer/factory_linux_test.go +++ b/libcontainer/factory_linux_test.go @@ -180,7 +180,7 @@ func TestFactoryLoadContainer(t *testing.T) { }, } ) - if err := os.Mkdir(filepath.Join(root, id), 0700); err != nil { + if err := os.Mkdir(filepath.Join(root, id), 0o700); err != nil { t.Fatal(err) } if err := marshal(filepath.Join(root, id, stateFilename), expectedState); err != nil {