@@ -24,7 +24,7 @@ import (
2424 "crypto/tls"
2525 "encoding/json"
2626 "fmt"
27- "io/ioutil "
27+ "io"
2828 "net/http"
2929 "os"
3030 "path"
@@ -138,7 +138,7 @@ func readJWTFile(file string) ([]byte, error) {
138138 }
139139
140140 defer f .Close ()
141- data , err := ioutil .ReadAll (f )
141+ data , err := io .ReadAll (f )
142142 if err != nil {
143143 return nil , err
144144 }
@@ -159,7 +159,7 @@ func getJWTToken() ([]byte, error) {
159159 return token , nil
160160 }
161161
162- if files , err := ioutil .ReadDir (probeInput .JWTPath ); err == nil {
162+ if files , err := os .ReadDir (probeInput .JWTPath ); err == nil {
163163 for _ , file := range files {
164164 if token , err := readJWTFile (file .Name ()); err == nil {
165165 log .Info ().Str ("token" , file .Name ()).Msgf ("Using JWT Token" )
@@ -224,7 +224,7 @@ func cmdLifecycleProbeRunE(cmd *cobra.Command) error {
224224
225225 if resp .StatusCode != http .StatusOK {
226226 if resp .Body != nil {
227- if data , err := ioutil .ReadAll (resp .Body ); err == nil {
227+ if data , err := io .ReadAll (resp .Body ); err == nil {
228228 return errors .Errorf ("Unexpected code: %d - %s" , resp .StatusCode , string (data ))
229229 }
230230 }
@@ -238,7 +238,7 @@ func cmdLifecycleProbeRunE(cmd *cobra.Command) error {
238238 if resp .Body == nil {
239239 return errors .Errorf ("Expected body from the \" %s\" endpoint" , endpoint )
240240 }
241- data , err := ioutil .ReadAll (resp .Body )
241+ data , err := io .ReadAll (resp .Body )
242242 if err != nil {
243243 return errors .Errorf ("Failed to read body from the \" %s\" endpoint" , endpoint )
244244 }
0 commit comments