diff --git a/cmd/ycat/ycat.go b/cmd/ycat/ycat.go index c70cb3bc..dbac4df9 100644 --- a/cmd/ycat/ycat.go +++ b/cmd/ycat/ycat.go @@ -3,7 +3,6 @@ package main import ( "errors" "fmt" - "io/ioutil" "os" "github.com/fatih/color" @@ -24,7 +23,7 @@ func _main(args []string) error { return errors.New("ycat: usage: ycat file.yml") } filename := args[1] - bytes, err := ioutil.ReadFile(filename) + bytes, err := os.ReadFile(filename) if err != nil { return err } diff --git a/decode.go b/decode.go index d3dbabcb..79117cae 100644 --- a/decode.go +++ b/decode.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "math" "os" "path/filepath" @@ -1621,7 +1620,7 @@ func (d *Decoder) resolveReference() error { } } for _, reader := range d.referenceReaders { - bytes, err := ioutil.ReadAll(reader) + bytes, err := io.ReadAll(reader) if err != nil { return errors.Wrapf(err, "failed to read buffer") } diff --git a/parser/parser.go b/parser/parser.go index 13ada50f..2bec5fea 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -2,7 +2,7 @@ package parser import ( "fmt" - "io/ioutil" + "os" "strings" "github.com/goccy/go-yaml/ast" @@ -730,7 +730,7 @@ func Parse(tokens token.Tokens, mode Mode) (*ast.File, error) { // Parse parse from filename, and returns ast.File func ParseFile(filename string, mode Mode) (*ast.File, error) { - file, err := ioutil.ReadFile(filename) + file, err := os.ReadFile(filename) if err != nil { return nil, errors.Wrapf(err, "failed to read file: %s", filename) }