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 <larry@theclapp.org>
This commit is contained in:
Larry Clapp
2019-08-13 20:16:19 -04:00
committed by Elias Naur
parent 7c197cc666
commit 56926a0449
+4 -2
View File
@@ -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