Skip to content

Commit

Permalink
Address staticcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Dec 29, 2017
1 parent de89cbf commit db66435
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions internal/cops/display/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ func (c Cursor) Reset(buf []byte) ([]byte, Cursor) {
c.Foreground = Colors[7]
c.Background = Colors[0]
buf = append(buf, "\033[m"...)
// Adding this superfluous return worked around staticcheck SA4005:
// ineffective assignment to Foreground/Background
return buf, c
}
return buf, c
}
Expand Down
1 change: 0 additions & 1 deletion internal/cops/examples/borkart/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@ Loop:
if err != nil {
return err
}
buf = buf[0:0]
return err
}
1 change: 0 additions & 1 deletion internal/cops/examples/braillewave/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ Loop:
buf, cur = cur.Clear(buf)
buf, cur = cur.Show(buf)
_, err = os.Stdout.Write(buf)
buf = buf[0:0]

return err
}
1 change: 0 additions & 1 deletion internal/cops/examples/earthgif/earthgif.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ Loop:
buf, cur = cur.Clear(buf)
buf, cur = cur.Show(buf)
_, err = os.Stdout.Write(buf)
buf = buf[0:0]

return err
}
Expand Down
1 change: 0 additions & 1 deletion internal/cops/examples/hicops/hicops.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func run() (err error) {
buf, cur = cur.Clear(buf)
buf, cur = cur.Show(buf)
_, err = os.Stdout.Write(buf)
buf = buf[0:0]

return err
}
1 change: 0 additions & 1 deletion internal/cops/examples/vt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ DrawLoop:
buf, cur = cur.Clear(buf)
buf, cur = cur.Show(buf)
_, err = os.Stdout.Write(buf)
buf = buf[0:0]

return err
}
2 changes: 1 addition & 1 deletion internal/perf/perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (perf *Perf) stopProfiling() (err error) {
}
perf.shouldProfile = false
perf.profiling = false
return nil
return err
}

func (perf *Perf) takeProfile() error {
Expand Down
2 changes: 1 addition & 1 deletion proofs/deathroom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (w *world) processRest() {
move, ent := cur.R(), cur.A()
if n := w.moves.Mag(move); ent.Type().HasAll(wcBody) && n >= maxRestingCharge {
w.moves.SetMag(move, n)
n = w.heal(ent, n)
_ = w.heal(ent, n)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion proofs/showroom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func run() (rerr error) {
commands, mute := input.Channel(os.Stdin)
defer mute()

sigwinch := make(chan os.Signal)
sigwinch := make(chan os.Signal, 1)
signal.Notify(sigwinch, syscall.SIGWINCH)

world := newWorld()
Expand Down
2 changes: 1 addition & 1 deletion proofs/splash/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func run() (rerr error) {
commands, mute := input.Channel(os.Stdin)
defer mute()

sigwinch := make(chan os.Signal)
sigwinch := make(chan os.Signal, 1)
signal.Notify(sigwinch, syscall.SIGWINCH)

ticker := time.NewTicker(time.Second / 60)
Expand Down

0 comments on commit db66435

Please sign in to comment.