From 591bf2d8ce817550b74c5c71bd6871aea73e4c61 Mon Sep 17 00:00:00 2001 From: JesusPerez Date: Mon, 6 Sep 2021 02:30:52 +0100 Subject: [PATCH] chore: fix args 0 --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c22854f..9063acf 100644 --- a/main.go +++ b/main.go @@ -448,7 +448,7 @@ func init() { } func main() { - if os.Args[1] == "-v" || os.Args[1] == "version" { + if len(os.Args) > 1 && (os.Args[1] == "-v" || os.Args[1] == "version") { fmt.Fprintf(os.Stdout, "{...} UpClapi version:%s\n",VERSION) os.Exit(0) } @@ -560,4 +560,4 @@ func ParseFlags() (RunFlags,error) { } // Return the configuration path return runFlags,nil -} \ No newline at end of file +}