From dcbdc009f56fe081256df2364b1cb65bef3c5406 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 21 May 2020 16:30:41 +0300 Subject: [PATCH] app/vmagent: check for error returned from flag.Set --- app/vmagent/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 00950e0511..66bd501b55 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -59,7 +59,9 @@ func main() { logger.Init() if *dryRun { - flag.Set("promscrape.config.strictParse", "true") + if err := flag.Set("promscrape.config.strictParse", "true"); err != nil { + logger.Panicf("BUG: cannot set promscrape.config.strictParse=true: %s", err) + } if err := remotewrite.CheckRelabelConfigs(); err != nil { logger.Fatalf("error when checking relabel configs: %s", err) }