Skip to content

Commit

Permalink
Merge pull request #4799 from medyagh/fixOutT
Browse files Browse the repository at this point in the history
Fix OutT to accept nil arg
  • Loading branch information
medyagh authored Jul 18, 2019
2 parents 054fc94 + e49d193 commit 3a93e45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/minikube/console/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func applyStyle(style StyleEnum, useColor bool, format string) string {
}

func applyTemplateFormatting(style StyleEnum, useColor bool, format string, a ...Arg) string {
if a == nil {
a = []Arg{Arg{}}
}
format = applyStyle(style, useColor, format)

var buf bytes.Buffer
Expand All @@ -161,9 +164,6 @@ func applyTemplateFormatting(style StyleEnum, useColor bool, format string, a ..
glog.Infof("Initializing template failed. Returning raw string.")
return format
}
if len(a) == 0 {
a[0] = Arg{}
}
err = t.Execute(&buf, a[0])
if err != nil {
glog.Infof("Executing template failed. Returning raw string.")
Expand Down

0 comments on commit 3a93e45

Please sign in to comment.