diff options
author | Chris Evich <cevich@redhat.com> | 2022-09-20 09:59:28 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2022-09-20 15:34:27 -0400 |
commit | d968f3fe09a4c7d74464cfe2eaa9e4febbe61ba5 (patch) | |
tree | edc3b78d1565b5df8074c0cf47c1d1cf1126a97a /cmd/podman/kube | |
parent | 30231d0da7e6dcf3d6d1f45b10150baae35aaf28 (diff) | |
download | podman-d968f3fe09a4c7d74464cfe2eaa9e4febbe61ba5.tar.gz podman-d968f3fe09a4c7d74464cfe2eaa9e4febbe61ba5.tar.bz2 podman-d968f3fe09a4c7d74464cfe2eaa9e4febbe61ba5.zip |
Replace deprecated ioutil
Package `io/ioutil` was deprecated in golang 1.16, preventing podman from
building under Fedora 37. Fortunately, functionality identical
replacements are provided by the packages `io` and `os`. Replace all
usage of all `io/ioutil` symbols with appropriate substitutions
according to the golang docs.
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'cmd/podman/kube')
-rw-r--r-- | cmd/podman/kube/generate.go | 5 | ||||
-rw-r--r-- | cmd/podman/kube/play.go | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/cmd/podman/kube/generate.go b/cmd/podman/kube/generate.go index ee2ea51ae..30b06b0c5 100644 --- a/cmd/podman/kube/generate.go +++ b/cmd/podman/kube/generate.go @@ -3,7 +3,6 @@ package kube import ( "fmt" "io" - "io/ioutil" "os" "github.com/containers/common/pkg/completion" @@ -77,7 +76,7 @@ func generateKube(cmd *cobra.Command, args []string) error { if err != nil { return err } - content, err := ioutil.ReadAll(report.Reader) + content, err := io.ReadAll(report.Reader) if err != nil { return err } @@ -89,7 +88,7 @@ func generateKube(cmd *cobra.Command, args []string) error { if _, err := os.Stat(generateFile); err == nil { return fmt.Errorf("cannot write to %q; file exists", generateFile) } - if err := ioutil.WriteFile(generateFile, content, 0644); err != nil { + if err := os.WriteFile(generateFile, content, 0644); err != nil { return fmt.Errorf("cannot write to %q: %w", generateFile, err) } return nil diff --git a/cmd/podman/kube/play.go b/cmd/podman/kube/play.go index c846ec32c..1163a6ff6 100644 --- a/cmd/podman/kube/play.go +++ b/cmd/podman/kube/play.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "net/http" "os" @@ -284,7 +283,7 @@ func readerFromArg(fileName string) (*bytes.Reader, error) { } defer response.Body.Close() - data, err := ioutil.ReadAll(response.Body) + data, err := io.ReadAll(response.Body) if err != nil { return nil, err } |