88 "bytes"
99 "encoding/json"
1010 "errors"
11- "io/ioutil"
1211 "math"
12+ "os"
1313 "path/filepath"
1414 "regexp"
1515 "sort"
@@ -301,7 +301,7 @@ func swapWidthHeightWithRotationInt32(rotation uint16, pWidth, pHeight *int32) {
301301}
302302
303303func getConfigVersion (filename string ) (string , error ) {
304- content , err := ioutil .ReadFile (filename )
304+ content , err := os .ReadFile (filename )
305305 if err != nil {
306306 return "" , err
307307 }
@@ -320,7 +320,7 @@ func getComputeChassis() (string, error) {
320320 return "" , err
321321 }
322322 if chassis == "" || chassis == "desktop" {
323- chassisNum , err := ioutil .ReadFile (chassisTypeFilePath )
323+ chassisNum , err := os .ReadFile (chassisTypeFilePath )
324324 if err != nil {
325325 logger .Warning (err )
326326 return "" , err
@@ -380,7 +380,7 @@ var regCardOutput = regexp.MustCompile(`^card\d+-.+`)
380380
381381func getStdMonitorName (edid []byte ) (string , error ) {
382382 // /sys/class/drm/card0-HDMI-A-1
383- fileInfos , err := ioutil .ReadDir ("/sys/class/drm" )
383+ fileInfos , err := os .ReadDir ("/sys/class/drm" )
384384 if err != nil {
385385 return "" , err
386386 }
@@ -413,6 +413,6 @@ func edidEqual(edid1, edid2 []byte) bool {
413413}
414414
415415func readSysDrmEdid (name string ) ([]byte , error ) {
416- content , err := ioutil .ReadFile (filepath .Join ("/sys/class/drm" , name , "edid" ))
416+ content , err := os .ReadFile (filepath .Join ("/sys/class/drm" , name , "edid" ))
417417 return content , err
418418}
0 commit comments