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:
Eng Zer Jun
2022-11-22 01:11:03 +08:00
committed by Itxaka
parent 9011ce3419
commit c868bbaf9e
4 changed files with 11 additions and 14 deletions

View File

@@ -2,7 +2,6 @@ package cmd
import (
"fmt"
"io/ioutil"
"os"
"github.com/kairos-io/kairos/internal/kairos"
@@ -19,7 +18,7 @@ func PrintText(f string, banner string) {
func PrintBranding(b []byte) {
brandingFile := kairos.BrandingFile("banner")
if _, err := os.Stat(brandingFile); err == nil {
f, err := ioutil.ReadFile(brandingFile)
f, err := os.ReadFile(brandingFile)
if err == nil {
fmt.Println(string(f))
}