From a704223bea3c97dc3a7f5755a1927c675c9d784c Mon Sep 17 00:00:00 2001 From: "James W. Brinkerhoff" Date: Mon, 3 Jun 2024 16:15:57 -0400 Subject: [PATCH] FS-1123: Enhancements to examples/bios --- examples/bios/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/bios/main.go b/examples/bios/main.go index 3acd683b..5425e68f 100644 --- a/examples/bios/main.go +++ b/examples/bios/main.go @@ -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) @@ -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) @@ -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"