diff --git a/cmd/driver/main.go b/cmd/driver/main.go index 842d124d..361d2d55 100644 --- a/cmd/driver/main.go +++ b/cmd/driver/main.go @@ -21,7 +21,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" - "io/ioutil" + "io" "log" "os" "strings" @@ -208,7 +208,7 @@ func main() { // disable the console logging (if anywhere else being done by softlayer or any other pkg) // presently softlayer logs few warning message, which makes the flexdriver unmarshall failure log.SetFlags(0) - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) // Divert all loggers outputs and fmt.printf loggings (this will create issues with flex response) NullDevice, _ := os.Open(os.DevNull) diff --git a/driver/driver.go b/driver/driver.go index 02ad4d7f..3a898b04 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -18,7 +18,6 @@ import ( "github.com/IBM/ibmcloud-object-storage-plugin/utils/backend" "github.com/IBM/ibmcloud-object-storage-plugin/utils/parser" "go.uber.org/zap" - "io/ioutil" "os" "os/exec" "path" @@ -54,7 +53,7 @@ var ( stat = os.Stat unmount = syscall.Unmount mount = syscall.Mount - writeFile = ioutil.WriteFile + writeFile = os.WriteFile mkdirAll = os.MkdirAll removeAll = os.RemoveAll //hostname, anyerror = os.Hostname() diff --git a/driver/driver_test.go b/driver/driver_test.go index e9b51a82..a7a860b8 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -20,7 +20,7 @@ import ( "github.com/IBM/ibmcloud-object-storage-plugin/utils/parser" "github.com/stretchr/testify/assert" "go.uber.org/zap" - "io/ioutil" + "io" "os" "os/exec" "path" @@ -116,7 +116,7 @@ func getPlugin() *S3fsPlugin { ret := exec.Command(os.Args[0], cs...) ret.Env = []string{"GO_WANT_HELPER_PROCESS=1"} if commandFailure { - ret.Stdout = ioutil.Discard + ret.Stdout = io.Discard } return ret } diff --git a/provisioner/ibm-s3fs-provisioner.go b/provisioner/ibm-s3fs-provisioner.go index ec44f202..318b9fdb 100644 --- a/provisioner/ibm-s3fs-provisioner.go +++ b/provisioner/ibm-s3fs-provisioner.go @@ -23,7 +23,6 @@ import ( "github.com/IBM/ibmcloud-object-storage-plugin/utils/uuid" "go.uber.org/zap" "google.golang.org/grpc" - "io/ioutil" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -133,7 +132,7 @@ type IBMS3fsProvisioner struct { } var _ controller.Provisioner = &IBMS3fsProvisioner{} -var writeFile = ioutil.WriteFile +var writeFile = os.WriteFile func UnixConnect(addr string, t time.Duration) (net.Conn, error) { unix_addr, _ := net.ResolveUnixAddr("unix", addr)