mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
@ -148,10 +147,10 @@ func (s *DockerSuite) TestPruneContainerLabel(c *testing.T) {
|
||||
|
||||
// Add a config file of label=foobar, that will have no impact if cli is label!=foobar
|
||||
config := `{"pruneFilters": ["label=foobar"]}`
|
||||
d, err := ioutil.TempDir("", "integration-cli-")
|
||||
d, err := os.MkdirTemp("", "integration-cli-")
|
||||
assert.NilError(c, err)
|
||||
defer os.RemoveAll(d)
|
||||
err = ioutil.WriteFile(filepath.Join(d, "config.json"), []byte(config), 0644)
|
||||
err = os.WriteFile(filepath.Join(d, "config.json"), []byte(config), 0644)
|
||||
assert.NilError(c, err)
|
||||
|
||||
// With config.json only, prune based on label=foobar
|
||||
@ -200,10 +199,10 @@ func (s *DockerSuite) TestPruneVolumeLabel(c *testing.T) {
|
||||
|
||||
// Add a config file of label=foobar, that will have no impact if cli is label!=foobar
|
||||
config := `{"pruneFilters": ["label=foobar"]}`
|
||||
d, err := ioutil.TempDir("", "integration-cli-")
|
||||
d, err := os.MkdirTemp("", "integration-cli-")
|
||||
assert.NilError(c, err)
|
||||
defer os.RemoveAll(d)
|
||||
err = ioutil.WriteFile(filepath.Join(d, "config.json"), []byte(config), 0644)
|
||||
err = os.WriteFile(filepath.Join(d, "config.json"), []byte(config), 0644)
|
||||
assert.NilError(c, err)
|
||||
|
||||
// With config.json only, prune based on label=foobar
|
||||
|
Reference in New Issue
Block a user