Skip to content

Commit

Permalink
Compare with nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Takumasa Sakao committed Nov 6, 2018
1 parent 233ef3d commit f961d67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion format/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Parse(r io.Reader) ([][]bool, error) {
case Life106:
return life106.Parse(contentReader), nil
case Life105:
return nil, fmt.Errorf("Life1.05 is not implemented")
return nil, fmt.Errorf("Life1.05 is not implemented\n")
default:
return rle.Parse(contentReader), nil
}
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func startGame(themes []Theme, presets []preset.Preset, themeIndex int, defaultC
width, height := s.Size()
b := NewBoard(height, width/2)

if len(defaultCells) == 0 {
if defaultCells == nil {
b.Random()
} else {
pheight := len(defaultCells)
Expand Down Expand Up @@ -183,7 +183,7 @@ func main() {
break
}
}
if len(defaultCells) == 0 {
if defaultCells == nil {
return fmt.Errorf("Invalid pattern name: %s\n", specifiedPattern)
}
}
Expand Down

0 comments on commit f961d67

Please sign in to comment.