Skip to content

Commit da43a71

Browse files
committed
Switch from deprecated ioutil to io/os
Signed-off-by: LogicalShark <maralder@google.com>
1 parent 21c4fde commit da43a71

File tree

7 files changed

+537
-14
lines changed

7 files changed

+537
-14
lines changed

cmd/auth-provider-gcp/app/getcredentials.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package app
1919
import (
2020
"encoding/json"
2121
"fmt"
22-
"io/ioutil"
22+
"io"
2323
"net/http"
2424
"os"
2525

@@ -112,7 +112,7 @@ func getCredentials(authFlow string) error {
112112
if err != nil {
113113
return err
114114
}
115-
unparsedRequest, err := ioutil.ReadAll(os.Stdin)
115+
unparsedRequest, err := io.ReadAll(os.Stdin)
116116
if err != nil {
117117
return err
118118
}

cmd/gke-gcloud-auth-plugin/cred.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"encoding/json"
1212
"flag"
1313
"fmt"
14-
"io/ioutil"
14+
"os"
1515
"os/exec"
1616
"path/filepath"
1717
"strings"
@@ -369,7 +369,7 @@ func executeCommand(name string, arg ...string) ([]byte, error) {
369369
}
370370

371371
func readFile(filename string) ([]byte, error) {
372-
return ioutil.ReadFile(filename)
372+
return os.ReadFile(filename)
373373
}
374374

375375
func timeNow() time.Time {

0 commit comments

Comments
 (0)