From 21f7a1f8c3c4e35c9dcad7e2b24ba381ec860f1a Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 14 Oct 2022 19:31:07 +0200 Subject: [PATCH] fix linting --- internal/app/wwctl/overlay/edit/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/app/wwctl/overlay/edit/main.go b/internal/app/wwctl/overlay/edit/main.go index b903ca36..96e0de36 100644 --- a/internal/app/wwctl/overlay/edit/main.go +++ b/internal/app/wwctl/overlay/edit/main.go @@ -78,6 +78,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Fprint(w, fmtStr) } fileDesc, err := os.OpenFile(overlayFile, os.O_RDWR, os.FileMode(PermMode)) + if err != nil { + wwlog.Warn("Could not open file for editing: %s", err) + } defer fileDesc.Close() _, _ = fileDesc.Seek(0, 0) hasher := sha256.New() @@ -96,6 +99,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { wwlog.Error("Problems getting checksum of file %s\n", err) } sum2 := hex.EncodeToString(hasher.Sum(nil)) + fmt.Println("sum1,sum2", sum1, sum2) if sum1 == sum2 && newFile { wwlog.Verbose("New template %s wasn't modified, deleting it", overlayFile) err = os.Remove(overlayFile)