Stop using deprecated ioutil functions

This commit is contained in:
Katrina Verey
2022-08-10 16:59:18 -04:00
parent 416eed97c4
commit f6b72077c8
70 changed files with 322 additions and 362 deletions

View File

@@ -5,7 +5,6 @@ package settersutil
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
@@ -85,7 +84,7 @@ func (c SubstitutionCreator) Create() error {
return err
}
curOpenAPI, err := ioutil.ReadFile(c.OpenAPIPath)
curOpenAPI, err := os.ReadFile(c.OpenAPIPath)
if err != nil {
return err
}
@@ -131,7 +130,7 @@ func (c SubstitutionCreator) Create() error {
// revert openAPI file if there are cycles detected in created input substitution
if err := c.checkForCycles(ext, visited); err != nil {
if writeErr := ioutil.WriteFile(c.OpenAPIPath, curOpenAPI, stat.Mode().Perm()); writeErr != nil {
if writeErr := os.WriteFile(c.OpenAPIPath, curOpenAPI, stat.Mode().Perm()); writeErr != nil {
return writeErr
}
return err