Skip to content

Commit

Permalink
FS-1123: Enhancements to examples/bios
Browse files Browse the repository at this point in the history
  • Loading branch information
splaspood committed Jun 3, 2024
1 parent a676832 commit a704223
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/bios/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func main() {

// Logger configuration
l := logrus.New()
l.Level = logrus.DebugLevel
// l.Level = logrus.TraceLevel
logger := logrusr.New(l)
logger.V(9)
Expand Down Expand Up @@ -62,7 +63,7 @@ func main() {
l.Fatal(err)
}

fmt.Printf("biosConfig: %+v\n", biosConfig)
fmt.Printf("biosConfig: %#v\n", biosConfig)
case "set":
exampleConfig := make(map[string]string)

Expand Down Expand Up @@ -95,18 +96,17 @@ func main() {
exampleConfig := make(map[string]string)

if *dfile != "" {
jsonFile, err := os.Open(*dfile)
cfgFile, err := os.Open(*dfile)
if err != nil {
l.Fatal(err)
}

defer jsonFile.Close()

jsonData, _ := io.ReadAll(jsonFile)
defer cfgFile.Close()

jsonData, _ := io.ReadAll(cfgFile)
err = json.Unmarshal(jsonData, &exampleConfig)
if err != nil {
l.Fatal(err)
l.Error(err)
}
} else {
exampleConfig["TpmSecurity"] = "Off"
Expand Down

0 comments on commit a704223

Please sign in to comment.