remove bool var from String func

pull/9855/head
alonyb 2020-12-09 18:22:22 -05:00
parent c24eda630c
commit 42aac91acd
8 changed files with 18 additions and 18 deletions

View File

@ -141,5 +141,5 @@ var printAddonsJSON = func(cc *config.ClusterConfig) {
}
jsonString, _ := json.Marshal(addonsMap)
out.String(string(jsonString), false)
out.String(string(jsonString))
}

View File

@ -177,11 +177,11 @@ func printProfilesJSON() {
body["valid"] = profilesOrDefault(validProfiles)
body["invalid"] = profilesOrDefault(invalidProfiles)
jsonString, _ := json.Marshal(body)
out.String(string(jsonString), false)
out.String(string(jsonString))
} else {
body["error"] = err
jsonString, _ := json.Marshal(body)
out.String(string(jsonString), false)
out.String(string(jsonString))
os.Exit(reason.ExGuestError)
}
}

View File

@ -36,7 +36,7 @@ func AskForYesNoConfirmation(s string, posResponses, negResponses []string) bool
reader := bufio.NewReader(os.Stdin)
for {
out.String("%s [y/n]: ", false, s)
out.String("%s [y/n]: ", s)
response, err := reader.ReadString('\n')
if err != nil {
@ -78,7 +78,7 @@ func AskForStaticValueOptional(s string) string {
}
func getStaticValue(reader *bufio.Reader, s string) string {
out.String("%s", false, s)
out.String("%s", s)
response, err := reader.ReadString('\n')
if err != nil {

View File

@ -37,9 +37,9 @@ var optionsCmd = &cobra.Command{
// runOptions handles the executes the flow of "minikube options"
func runOptions(cmd *cobra.Command, args []string) {
out.String("The following options can be passed to any command:\n\n", false)
out.String("The following options can be passed to any command:\n\n")
cmd.Root().PersistentFlags().VisitAll(func(flag *pflag.Flag) {
out.String(flagUsage(flag), false)
out.String(flagUsage(flag))
})
}

View File

@ -155,12 +155,12 @@ func openURLs(svc string, urls []string) {
_, err := url.Parse(u)
if err != nil {
klog.Warningf("failed to parse url %q: %v (will not open)", u, err)
out.String(fmt.Sprintf("%s\n", u), false)
out.String(fmt.Sprintf("%s\n", u))
continue
}
if serviceURLMode {
out.String(fmt.Sprintf("%s\n", u), false)
out.String(fmt.Sprintf("%s\n", u))
continue
}

View File

@ -40,26 +40,26 @@ func MaybeDisplayAdvice(err error, driver string) {
if errors.Is(err, oci.ErrExitedUnexpectedly) || errors.Is(err, oci.ErrDaemonInfo) {
out.Step(style.Tip, out.NoSpinner, "If you are still interested to make {{.driver_name}} driver work. The following suggestions might help you get passed this issue:", out.V{"driver_name": driver})
if driver == oci.Docker || driver == oci.Podman {
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Prune unused {{.driver_name}} images, volumes, networks and abandoned containers.
{{.driver_name}} system prune --volumes`, out.V{"driver_name": driver})
}
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Restart your {{.driver_name}} service`, out.V{"driver_name": driver})
if runtime.GOOS != "linux" {
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Ensure your {{.driver_name}} daemon has access to enough CPU/memory resources.`, out.V{"driver_name": driver})
if runtime.GOOS == "darwin" && driver == oci.Docker {
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Docs https://docs.docker.com/docker-for-mac/#resources`, out.V{"driver_name": driver})
}
if runtime.GOOS == "windows" && driver == oci.Docker {
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Docs https://docs.docker.com/docker-for-windows/#resources`, out.V{"driver_name": driver})
}
}
out.String("\n\t", false)
out.String("\n\t")
out.Step(style.Empty, out.NoSpinner, `- Delete and recreate minikube cluster
minikube delete
minikube start --driver={{.driver_name}}`, out.V{"driver_name": driver})

View File

@ -107,7 +107,7 @@ func Infof(format string, a ...V) {
register.PrintInfo(outStyled)
return
}
String(outStyled, false)
String(outStyled)
}
// String writes a basic formatted string to stdout

View File

@ -89,9 +89,9 @@ func TestOut(t *testing.T) {
SetOutFile(f)
ErrLn("unrelated message")
if tc.arg == nil {
String(tc.format, false)
String(tc.format)
} else {
String(tc.format, false, tc.arg)
String(tc.format, tc.arg)
}
got := f.String()
if got != tc.want {