From 9b2eeb0e55b8ae1df96193de35ab676fc71e0b44 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 27 Sep 2024 01:37:38 -0700 Subject: [PATCH] Use formatting print to show underlying error message (#500) * Use formatting print to show underlying error message This appears to be a typo where "Println" was used instead of "Printf" Signed-off-by: Kenny Root * Update collector/collector.go --------- Signed-off-by: Kenny Root Co-authored-by: Ettore Di Giacinto --- collector/collector.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collector/collector.go b/collector/collector.go index 45aa3bb..49a619c 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -464,7 +464,12 @@ func fetchRemoteConfig(url string) (*Config, error) { if !HasValidHeader(string(body)) { // TODO: Print a warning when we implement proper logging - fmt.Println("No valid header in remote config: %w", err) + if err != nil { + fmt.Printf("No valid header in remote config: %s\n", err.Error()) + } else { + fmt.Println("No valid header in remote config") + } + return result, nil }