Skip to content

Commit 22145a3

Browse files
committed
chore: remove refs to deprecated io/ioutil
1 parent 675ba2d commit 22145a3

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

cmd/driver/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"go.uber.org/zap"
2222
"go.uber.org/zap/zapcore"
2323
"gopkg.in/natefinch/lumberjack.v2"
24-
"io/ioutil"
24+
"io"
2525
"log"
2626
"os"
2727
"strings"
@@ -208,7 +208,7 @@ func main() {
208208
// disable the console logging (if anywhere else being done by softlayer or any other pkg)
209209
// presently softlayer logs few warning message, which makes the flexdriver unmarshall failure
210210
log.SetFlags(0)
211-
log.SetOutput(ioutil.Discard)
211+
log.SetOutput(io.Discard)
212212

213213
// Divert all loggers outputs and fmt.printf loggings (this will create issues with flex response)
214214
NullDevice, _ := os.Open(os.DevNull)

driver/driver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/IBM/ibmcloud-object-storage-plugin/utils/backend"
1919
"github.com/IBM/ibmcloud-object-storage-plugin/utils/parser"
2020
"go.uber.org/zap"
21-
"io/ioutil"
2221
"os"
2322
"os/exec"
2423
"path"
@@ -54,7 +53,7 @@ var (
5453
stat = os.Stat
5554
unmount = syscall.Unmount
5655
mount = syscall.Mount
57-
writeFile = ioutil.WriteFile
56+
writeFile = os.WriteFile
5857
mkdirAll = os.MkdirAll
5958
removeAll = os.RemoveAll
6059
//hostname, anyerror = os.Hostname()

driver/driver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/IBM/ibmcloud-object-storage-plugin/utils/parser"
2121
"github.com/stretchr/testify/assert"
2222
"go.uber.org/zap"
23-
"io/ioutil"
23+
"io"
2424
"os"
2525
"os/exec"
2626
"path"
@@ -116,7 +116,7 @@ func getPlugin() *S3fsPlugin {
116116
ret := exec.Command(os.Args[0], cs...)
117117
ret.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
118118
if commandFailure {
119-
ret.Stdout = ioutil.Discard
119+
ret.Stdout = io.Discard
120120
}
121121
return ret
122122
}

provisioner/ibm-s3fs-provisioner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/IBM/ibmcloud-object-storage-plugin/utils/uuid"
2424
"go.uber.org/zap"
2525
"google.golang.org/grpc"
26-
"io/ioutil"
2726
"k8s.io/api/core/v1"
2827
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2928
"k8s.io/client-go/kubernetes"
@@ -133,7 +132,7 @@ type IBMS3fsProvisioner struct {
133132
}
134133

135134
var _ controller.Provisioner = &IBMS3fsProvisioner{}
136-
var writeFile = ioutil.WriteFile
135+
var writeFile = os.WriteFile
137136

138137
func UnixConnect(addr string, t time.Duration) (net.Conn, error) {
139138
unix_addr, _ := net.ResolveUnixAddr("unix", addr)

0 commit comments

Comments
 (0)