From c4170d3955a6ee18aac2c1f8be68b0f279bd3872 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sat, 25 Mar 2023 15:14:30 +0100 Subject: [PATCH] refactor: move from deprecated io/ioutil package --- cmd/php-parser/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index db931ff..c406bdb 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -5,7 +5,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -120,7 +119,7 @@ func processPath(pathList []string, fileCh chan<- *file) { err = filepath.Walk(real, func(path string, f os.FileInfo, err error) error { if !f.IsDir() && filepath.Ext(path) == ".php" { wg.Add(1) - content, err := ioutil.ReadFile(path) + content, err := os.ReadFile(path) checkErr(err) fileCh <- &file{path, content} } @@ -181,7 +180,7 @@ func printerWorker(r <-chan result) { p := printer.NewPrinter(o) res.rootNode.Accept(p) - err := ioutil.WriteFile(res.path, o.Bytes(), 0644) + err := os.WriteFile(res.path, o.Bytes(), 0644) checkErr(err) }