io/ioutil deprecated (#3217)
This commit is contained in:
@@ -2,7 +2,6 @@ package generator
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -36,5 +35,5 @@ func (g *Generator) GenConfig(ctx DirContext, _ parser.Proto, cfg *conf.Config)
|
||||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(fileName, []byte(text), os.ModePerm)
|
||||
return os.WriteFile(fileName, []byte(text), os.ModePerm)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -14,7 +13,7 @@ import (
|
||||
func Test_findPbFile(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
protoFile := filepath.Join(dir, "greet.proto")
|
||||
err := ioutil.WriteFile(protoFile, []byte(`
|
||||
err := os.WriteFile(protoFile, []byte(`
|
||||
syntax = "proto3";
|
||||
|
||||
package greet;
|
||||
|
||||
Reference in New Issue
Block a user