mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-25 22:23:15 +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,7 @@ package profile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/kairos-io/kairos/pkg/utils"
|
||||
@@ -19,7 +19,7 @@ type profileFileStruct struct {
|
||||
}
|
||||
|
||||
func BuildFlavor(flavor string, profileFile string, directory string) error {
|
||||
dat, err := ioutil.ReadFile(profileFile)
|
||||
dat, err := os.ReadFile(profileFile)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("error while reading profile: %w", err)
|
||||
@@ -55,7 +55,7 @@ func BuildFlavor(flavor string, profileFile string, directory string) error {
|
||||
|
||||
func readProfilePackages(profile string, profileFile string) ([]string, error) {
|
||||
res := []string{}
|
||||
dat, err := ioutil.ReadFile(profileFile)
|
||||
dat, err := os.ReadFile(profileFile)
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("error while reading profile: %w", err)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func readProfilePackages(profile string, profileFile string) ([]string, error) {
|
||||
|
||||
func readCommonPackages(profileFile string) ([]string, error) {
|
||||
res := []string{}
|
||||
dat, err := ioutil.ReadFile(profileFile)
|
||||
dat, err := os.ReadFile(profileFile)
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("error while reading profile: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user