From 3a555b4804637c6e2a969a4400261487fe7df4ee Mon Sep 17 00:00:00 2001 From: Ricardo Mateus Date: Mon, 20 May 2024 15:51:05 +0100 Subject: [PATCH] improve error info when open a file Signed-off-by: Ricardo Mateus --- utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index ea493b4..90bf1b1 100755 --- a/utils/utils.go +++ b/utils/utils.go @@ -125,7 +125,7 @@ func getProperty(filePaths []string, names []string) (string, error) { func ScannerFunc(path string, search string) (string, error) { f, err := os.Open(path) if err != nil { - log.Fatal().Msgf("Couldn't open file: %s", path) + log.Fatal().Err(err).Msgf("Couldn't open file: %s", path) } defer f.Close() scanner := bufio.NewScanner(f)