From 9a4a7fe5bac4b48388a55382f6c8273b9685a2af Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 3 Jun 2017 00:51:15 +0900 Subject: [PATCH] examples: Remove unneeded error checks --- examples/2048/2048/tile.go | 10 ++-------- examples/audio/main.go | 19 ++++--------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/examples/2048/2048/tile.go b/examples/2048/2048/tile.go index e5972c0b7..1222bea64 100644 --- a/examples/2048/2048/tile.go +++ b/examples/2048/2048/tile.go @@ -285,14 +285,8 @@ var ( ) func init() { - var err error - tileImage, err = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest) - if err != nil { - panic(err) - } - if err := tileImage.Fill(color.White); err != nil { - panic(err) - } + tileImage, _ = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest) + tileImage.Fill(color.White) } func (t *Tile) Draw(boardImage *ebiten.Image) { diff --git a/examples/audio/main.go b/examples/audio/main.go index 0839fe79f..c6160557f 100644 --- a/examples/audio/main.go +++ b/examples/audio/main.go @@ -41,22 +41,11 @@ var ( ) func init() { - var err error - playerBarImage, err = ebiten.NewImage(300, 4, ebiten.FilterNearest) - if err != nil { - log.Fatal(err) - } - if err := playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff}); err != nil { - log.Fatal(err) - } + playerBarImage, _ = ebiten.NewImage(300, 4, ebiten.FilterNearest) + playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff}) - playerCurrentImage, err = ebiten.NewImage(4, 10, ebiten.FilterNearest) - if err != nil { - log.Fatal(err) - } - if err := playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff}); err != nil { - log.Fatal(err) - } + playerCurrentImage, _ = ebiten.NewImage(4, 10, ebiten.FilterNearest) + playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff}) } type Player struct {