mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-01 15:18:10 +00:00
art: Move from io/ioutil to io and os packages (#470)
refactor: move from io/ioutil to io and os packages The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@ package system
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -45,7 +44,7 @@ func writeCloudConfig(oem state.PartitionState, cloudConfig, subpath, filename s
|
||||
machine.Umount(mountPath) //nolint:errcheck
|
||||
}()
|
||||
_ = os.MkdirAll(filepath.Join(mountPath, subpath), 0650)
|
||||
return ioutil.WriteFile(filepath.Join(mountPath, subpath, fmt.Sprintf("%s.yaml", filename)), []byte(cloudConfig), 0650)
|
||||
return os.WriteFile(filepath.Join(mountPath, subpath, fmt.Sprintf("%s.yaml", filename)), []byte(cloudConfig), 0650)
|
||||
}
|
||||
|
||||
// WriteCloudConfigData adds cloud config data to oem (/oem or /usr/local/cloud-config, depending if OEM partition exists).
|
||||
|
Reference in New Issue
Block a user