Skip to content

Commit

Permalink
Fix warnings produced by staticcheck (#231)
Browse files Browse the repository at this point in the history
I just ran [staticcheck.io](https://staticcheck.io) over the repository
and these came up.
  • Loading branch information
mrnugget committed Jun 24, 2020
1 parent e6a62f3 commit f567168
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/src/extensions_publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Notes:

manifest, err := ioutil.ReadFile(*manifestFlag)
if err != nil {
return fmt.Errorf("%s\n\nRun this command in a directory with a %s file for an extension.\n\nSee 'src extensions %s -h' for help.", err, *manifestFlag, flagSet.Name())
return fmt.Errorf("%s\n\nRun this command in a directory with a %s file for an extension.\n\nSee 'src extensions %s -h' for help", err, *manifestFlag, flagSet.Name())
}
extensionID := *extensionIDFlag
if extensionID == "" {
Expand Down
8 changes: 4 additions & 4 deletions internal/campaigns/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (w *progressWriter) Write(data []byte) (int, error) {
}
bar += strings.Repeat(" ", maxLength-len(bar))
progessText := fmt.Sprintf("[%s] Steps: %d/%d (%s, %s)", bar, w.p.StepsComplete(), w.p.TotalSteps(), boldRed.Sprintf("%d failed", w.p.TotalStepsFailed()), hiGreen.Sprintf("%d patches", w.p.PatchCount()))
fmt.Fprintf(w.w, progessText)
fmt.Fprint(w.w, progessText)
w.shouldClear = true
w.progressLogLength = len(progessText)
return n, err
Expand All @@ -366,7 +366,7 @@ func (w *progressWriter) clear() {
if !w.shouldClear {
return
}
fmt.Fprintf(w.w, "\r")
fmt.Fprintf(w.w, strings.Repeat(" ", w.progressLogLength))
fmt.Fprintf(w.w, "\r")
fmt.Fprint(w.w, "\r")
fmt.Fprint(w.w, strings.Repeat(" ", w.progressLogLength))
fmt.Fprint(w.w, "\r")
}

0 comments on commit f567168

Please sign in to comment.