Skip to content

Commit

Permalink
chore: unnecessary use of fmt.Sprint or fmt.Sprintf (#818)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
testwill authored Aug 7, 2023
1 parent 592be23 commit a8b74b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/goss/goss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
})
Expand Down
4 changes: 2 additions & 2 deletions outputs/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -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
Expand Down

0 comments on commit a8b74b4

Please sign in to comment.