Skip to content

Commit f961d67

Browse files
author
Takumasa Sakao
committed
Compare with nil
1 parent 233ef3d commit f961d67

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

format/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func Parse(r io.Reader) ([][]bool, error) {
2929
case Life106:
3030
return life106.Parse(contentReader), nil
3131
case Life105:
32-
return nil, fmt.Errorf("Life1.05 is not implemented")
32+
return nil, fmt.Errorf("Life1.05 is not implemented\n")
3333
default:
3434
return rle.Parse(contentReader), nil
3535
}

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func startGame(themes []Theme, presets []preset.Preset, themeIndex int, defaultC
4242
width, height := s.Size()
4343
b := NewBoard(height, width/2)
4444

45-
if len(defaultCells) == 0 {
45+
if defaultCells == nil {
4646
b.Random()
4747
} else {
4848
pheight := len(defaultCells)
@@ -183,7 +183,7 @@ func main() {
183183
break
184184
}
185185
}
186-
if len(defaultCells) == 0 {
186+
if defaultCells == nil {
187187
return fmt.Errorf("Invalid pattern name: %s\n", specifiedPattern)
188188
}
189189
}

0 commit comments

Comments
 (0)