From a8b74b414fc2be4fc8e6f4d131c9698e166989cf Mon Sep 17 00:00:00 2001 From: guangwu Date: Mon, 7 Aug 2023 21:48:30 +0800 Subject: [PATCH] chore: unnecessary use of fmt.Sprint or fmt.Sprintf (#818) Signed-off-by: guoguangwu --- cmd/goss/goss.go | 4 ++-- outputs/outputs.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/goss/goss.go b/cmd/goss/goss.go index 203ac1e8d..2d1a55c9a 100644 --- a/cmd/goss/goss.go +++ b/cmd/goss/goss.go @@ -210,7 +210,7 @@ func main() { Flags: []cli.Flag{ cli.BoolFlag{ Name: "debug, d", - Usage: fmt.Sprintf("Print debugging info when rendering"), + Usage: "Print debugging info when rendering", }, }, Action: func(c *cli.Context) error { @@ -415,7 +415,7 @@ func addAlphaFlagIfNeeded(app *cli.App) { if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { app.Flags = append(app.Flags, cli.StringFlag{ Name: "use-alpha", - Usage: fmt.Sprintf("goss on macOS/Windows is alpha-quality. Set to 1 to use anyway."), + Usage: "goss on macOS/Windows is alpha-quality. Set to 1 to use anyway.", EnvVar: "GOSS_USE_ALPHA", Value: "0", }) diff --git a/outputs/outputs.go b/outputs/outputs.go index c4e8d2ece..9aeb72e87 100644 --- a/outputs/outputs.go +++ b/outputs/outputs.go @@ -242,7 +242,7 @@ func summary(startTime, endTime time.Time, count, failed, skipped int) string { func failedOrSkippedSummary(failedOrSkipped [][]resource.TestResult, includeRaw bool) string { var s string if len(failedOrSkipped) > 0 { - s += fmt.Sprint("Failures/Skipped:\n\n") + s += "Failures/Skipped:\n\n" sort.Slice(failedOrSkipped, func(i, j int) bool { return failedOrSkipped[i][0].SortKey() < failedOrSkipped[j][0].SortKey() }) @@ -255,7 +255,7 @@ func failedOrSkippedSummary(failedOrSkipped [][]resource.TestResult, includeRaw for _, testResult := range failedGroup { s += fmt.Sprintln(humanizeResult(testResult, false, includeRaw)) } - s += fmt.Sprint("\n") + s += "\n" } } return s