mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-17 13:11:48 +00:00
Remove deprecated io/ioutil usage
Issue #1658 Signed-off-by: Allen Porter <allen@thebends.org>
This commit is contained in:
parent
ba1bba17ad
commit
8b68d7d7e2
1 changed files with 2 additions and 3 deletions
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
|
@ -24,7 +23,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func readYamlObjects(objectFile string) ([]client.Object, error) {
|
func readYamlObjects(objectFile string) ([]client.Object, error) {
|
||||||
obj, err := ioutil.ReadFile(objectFile)
|
obj, err := os.ReadFile(objectFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +135,7 @@ func (cmd *cmdTestCase) runTestCmd(t *testing.T) {
|
||||||
expected = cmd.goldenValue
|
expected = cmd.goldenValue
|
||||||
}
|
}
|
||||||
if cmd.goldenFile != "" {
|
if cmd.goldenFile != "" {
|
||||||
expectedOutput, err := ioutil.ReadFile(cmd.goldenFile)
|
expectedOutput, err := os.ReadFile(cmd.goldenFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error reading golden file: '%s'", err)
|
t.Fatalf("Error reading golden file: '%s'", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue