From 38e86531d6c9b88ff8f9c1db6a2b21c72e5cdd5a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Feb 2022 14:36:05 +0100 Subject: [PATCH] cli/compose: remove deprecated io/ioutil Signed-off-by: Sebastiaan van Stijn (cherry picked from commit b9f0340b68d50491e6dd5f7f49af4c1c1aa8de54) Signed-off-by: Cory Snider --- cli/compose/convert/compose.go | 4 ++-- cli/compose/loader/loader_test.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/compose/convert/compose.go b/cli/compose/convert/compose.go index 189a909622..98cd92989b 100644 --- a/cli/compose/convert/compose.go +++ b/cli/compose/convert/compose.go @@ -1,7 +1,7 @@ package convert import ( - "io/ioutil" + "os" "strings" composetypes "github.com/docker/cli/cli/compose/types" @@ -178,7 +178,7 @@ func driverObjectConfig(namespace Namespace, name string, obj composetypes.FileO } func fileObjectConfig(namespace Namespace, name string, obj composetypes.FileObjectConfig) (swarmFileObject, error) { - data, err := ioutil.ReadFile(obj.File) + data, err := os.ReadFile(obj.File) if err != nil { return swarmFileObject{}, err } diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index db57dba24a..4b2fc9cbb6 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -2,7 +2,6 @@ package loader import ( "bytes" - "io/ioutil" "os" "reflect" "sort" @@ -946,7 +945,7 @@ func uint32Ptr(value uint32) *uint32 { } func TestFullExample(t *testing.T) { - bytes, err := ioutil.ReadFile("full-example.yml") + bytes, err := os.ReadFile("full-example.yml") assert.NilError(t, err) homeDir := "/home/foo"