Skip to content

Commit

Permalink
Shorten if blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Mar 25, 2021
1 parent 16a1016 commit d4685c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func executeCommand(cmd string) {
log.Printf("command failed: %s", err)
return
}
err := c.Wait()
if err != nil {

if err := c.Wait(); err != nil {
log.Printf("command failed: %s", err)
}
}
Expand Down
3 changes: 1 addition & 2 deletions widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ func drawString(img *image.RGBA, ttf *truetype.Font, text string, fontsize float
}

c.SetSrc(image.NewUniform(color.RGBA{255, 255, 255, 255}))
_, err := c.DrawString(text, pt)
if err != nil {
if _, err := c.DrawString(text, pt); err != nil {
log.Fatal(err)
}
}
Expand Down

0 comments on commit d4685c0

Please sign in to comment.