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 <Kenta.Tada@sony.com>
This commit is contained in:
Kenta Tada
2021-03-02 16:26:36 +09:00
parent 1820c42547
commit 8a3484b736
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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 {
+1 -1
View File
@@ -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 {