From 56926a04499058f64b8bb58783bc233149e199b6 Mon Sep 17 00:00:00 2001 From: Larry Clapp Date: Tue, 13 Aug 2019 20:16:19 -0400 Subject: [PATCH] ui/app: fix init() appending '' to os.Args init() says args := strings.Split(extraArgs, "|") os.Args = append(os.Args, args...) strings.Split says If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s. which means init() adds a blank arg to the end of os.Args when extraArgs is empty. This fixes that. Signed-off-by: Larry Clapp --- ui/app/app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/app/app.go b/ui/app/app.go index 1613be63..26331a82 100644 --- a/ui/app/app.go +++ b/ui/app/app.go @@ -118,8 +118,10 @@ func (l Stage) String() string { } func init() { - args := strings.Split(extraArgs, "|") - os.Args = append(os.Args, args...) + if extraArgs != "" { + args := strings.Split(extraArgs, "|") + os.Args = append(os.Args, args...) + } } // DataDir returns a path to use for application-specific