66 "encoding/json"
77 "errors"
88 "fmt"
9- "io/ioutil "
9+ "io"
1010 "net/http"
1111 _ "net/http/pprof"
1212 "os"
@@ -50,7 +50,7 @@ func Run(cmd *cobra.Command, args []string) {
5050 }
5151 defer file .Close ()
5252
53- b , err := ioutil .ReadAll (file )
53+ b , err := io .ReadAll (file )
5454 if err != nil {
5555 logs .Log .Fatalf ("Failed to read config file: %s" , err )
5656 }
@@ -194,7 +194,7 @@ func gatherAndOutputData(config Config, preflightClient client.Client, dataGathe
194194
195195 if Flags .InputPath != "" {
196196 logs .Log .Printf ("Reading data from local file: %s" , Flags .InputPath )
197- data , err := ioutil .ReadFile (Flags .InputPath )
197+ data , err := os .ReadFile (Flags .InputPath )
198198 if err != nil {
199199 logs .Log .Fatalf ("failed to read local data file: %s" , err )
200200 }
@@ -211,7 +211,7 @@ func gatherAndOutputData(config Config, preflightClient client.Client, dataGathe
211211 if err != nil {
212212 logs .Log .Fatal ("failed to marshal JSON" )
213213 }
214- err = ioutil .WriteFile (Flags .OutputPath , data , 0644 )
214+ err = os .WriteFile (Flags .OutputPath , data , 0644 )
215215 if err != nil {
216216 logs .Log .Fatalf ("failed to output to local file: %s" , err )
217217 }
@@ -320,7 +320,7 @@ func postData(config Config, preflightClient client.Client, readings []*api.Data
320320 }
321321 if code := res .StatusCode ; code < 200 || code >= 300 {
322322 errorContent := ""
323- body , _ := ioutil .ReadAll (res .Body )
323+ body , _ := io .ReadAll (res .Body )
324324 if err == nil {
325325 errorContent = string (body )
326326 }
0 commit comments