mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #111566 from inosato/remove-ioutil-from-code-generator
Remove ioutil from code-generator
This commit is contained in:
commit
8887ac620d
@ -19,7 +19,7 @@ package generators
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
openapiv2 "github.com/google/gnostic/openapiv2"
|
||||
@ -42,7 +42,7 @@ func newTypeModels(openAPISchemaFilePath string, pkgTypes map[string]*types.Pack
|
||||
return emptyModels, nil // No Extract<type>() functions will be generated.
|
||||
}
|
||||
|
||||
rawOpenAPISchema, err := ioutil.ReadFile(openAPISchemaFilePath)
|
||||
rawOpenAPISchema, err := os.ReadFile(openAPISchemaFilePath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read openapi-schema file: %w", err)
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"go/parser"
|
||||
"go/printer"
|
||||
"go/token"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
@ -35,7 +34,7 @@ import (
|
||||
|
||||
func rewriteFile(name string, header []byte, rewriteFn func(*token.FileSet, *ast.File) error) error {
|
||||
fset := token.NewFileSet()
|
||||
src, err := ioutil.ReadFile(name)
|
||||
src, err := os.ReadFile(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user