diff --git a/backend/gce/metadata.go b/backend/gce/metadata.go index 962adca80..fff479ec8 100644 --- a/backend/gce/metadata.go +++ b/backend/gce/metadata.go @@ -17,7 +17,7 @@ package gce import ( - "io/ioutil" + "io" "net/http" "path" "strings" @@ -69,7 +69,7 @@ func metadataGet(path string) (string, error) { return "", err } defer resp.Body.Close() - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return "", err } diff --git a/backend/tencentvpc/tencentvpc.go b/backend/tencentvpc/tencentvpc.go index f4ab9f3cc..d76695b1d 100644 --- a/backend/tencentvpc/tencentvpc.go +++ b/backend/tencentvpc/tencentvpc.go @@ -19,7 +19,7 @@ package tencentvpc import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "os" "sync" @@ -60,7 +60,7 @@ func get_vm_metadata(url string) (string, error) { defer resp.Body.Close() - metadata, _ := ioutil.ReadAll(resp.Body) + metadata, _ := io.ReadAll(resp.Body) return string(metadata), nil } diff --git a/backend/wireguard/device.go b/backend/wireguard/device.go index c5ed9c8cd..6a5ffc834 100644 --- a/backend/wireguard/device.go +++ b/backend/wireguard/device.go @@ -19,7 +19,6 @@ package wireguard import ( "errors" "fmt" - "io/ioutil" "net" "os" "path/filepath" @@ -100,7 +99,7 @@ func (devAttrs *wgDeviceAttrs) setupKeys(psk string) error { return fmt.Errorf("could not write key file: %w", err) } } else { - data, err := ioutil.ReadFile(keyFile) + data, err := os.ReadFile(keyFile) if err != nil { return err } diff --git a/subnet/kube/kube.go b/subnet/kube/kube.go index be0dd4615..5c924e2ff 100644 --- a/subnet/kube/kube.go +++ b/subnet/kube/kube.go @@ -18,7 +18,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "net" "os" "strconv" @@ -101,7 +100,7 @@ func NewSubnetManager(ctx context.Context, apiUrl, kubeconfig, prefix, netConfPa } } - netConf, err := ioutil.ReadFile(netConfPath) + netConf, err := os.ReadFile(netConfPath) if err != nil { return nil, fmt.Errorf("failed to read net conf: %v", err) }