From 4a8766e1e33c12f428d1d52f7fc7dbcceb666385 Mon Sep 17 00:00:00 2001 From: Michail Safronov Date: Tue, 14 May 2024 14:02:54 +0500 Subject: [PATCH] fix(main): empty args cmd line parsing panic (#279) --- graphite-clickhouse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphite-clickhouse.go b/graphite-clickhouse.go index c5c99bd5..a3747cea 100644 --- a/graphite-clickhouse.go +++ b/graphite-clickhouse.go @@ -417,7 +417,7 @@ func main() { fmt.Fprintf(os.Stderr, " match Match metric against rollup rules\n") } - if len(os.Args) > 0 { + if len(os.Args) > 1 { switch os.Args[1] { case "sd-list", "-sd-list": sdList(os.Args[0], os.Args[2:])