@@ -11,7 +11,6 @@ import (
1111 "fmt"
1212 "go/parser"
1313 "go/token"
14- "io/ioutil"
1514 "os"
1615 "path/filepath"
1716 "runtime/debug"
@@ -693,7 +692,7 @@ func PrepareEnv(c *Config) (undo func() error, err error) {
693692 nop = func () error { return nil }
694693 path = filepath .Join (c .Target , "runtime.go" )
695694 )
696- out , err := ioutil .ReadFile (path )
695+ out , err := os .ReadFile (path )
697696 if err != nil {
698697 if os .IsNotExist (err ) {
699698 return nop , nil
@@ -708,10 +707,10 @@ func PrepareEnv(c *Config) (undo func() error, err error) {
708707 if len (fi .Imports ) == 0 {
709708 return nop , nil
710709 }
711- if err := ioutil .WriteFile (path , append ([]byte ("// +build tools\n " ), out ... ), 0644 ); err != nil {
710+ if err := os .WriteFile (path , append ([]byte ("// +build tools\n " ), out ... ), 0644 ); err != nil {
712711 return nil , err
713712 }
714- return func () error { return ioutil .WriteFile (path , out , 0644 ) }, nil
713+ return func () error { return os .WriteFile (path , out , 0644 ) }, nil
715714}
716715
717716type (
@@ -733,7 +732,7 @@ func (a assets) write() error {
733732 }
734733 }
735734 for _ , file := range a .files {
736- if err := ioutil .WriteFile (file .path , file .content , 0644 ); err != nil {
735+ if err := os .WriteFile (file .path , file .content , 0644 ); err != nil {
737736 return fmt .Errorf ("write file %q: %w" , file .path , err )
738737 }
739738 }
@@ -748,7 +747,7 @@ func (a assets) format() error {
748747 if err != nil {
749748 return fmt .Errorf ("format file %s: %w" , path , err )
750749 }
751- if err := ioutil .WriteFile (path , src , 0644 ); err != nil {
750+ if err := os .WriteFile (path , src , 0644 ); err != nil {
752751 return fmt .Errorf ("write file %s: %w" , path , err )
753752 }
754753 }
0 commit comments