internal/processteset/testdta: bug fix: compile error

This commit is contained in:
Hajime Hoshi 2022-10-16 15:26:08 +09:00
parent 67178c9534
commit 966823e445

View File

@ -18,19 +18,22 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"image/color" "image/color"
"github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2"
) )
var regularTermination = errors.New("regular termination")
type Game struct { type Game struct {
drawCount int drawCount int
} }
func (g *Game) Update() error { func (g *Game) Update() error {
if g.drawCount == 2 { if g.drawCount == 2 {
return ebiten.Termination return regularTermination
} }
return nil return nil
} }
@ -56,7 +59,7 @@ func main() {
ebiten.SetWindowTitle("Test") ebiten.SetWindowTitle("Test")
ebiten.SetScreenClearedEveryFrame(false) ebiten.SetScreenClearedEveryFrame(false)
if err := ebiten.RunGame(&Game{}); err != nil { if err := ebiten.RunGame(&Game{}); err != nil && !errors.Is(err, regularTermination) {
panic(err) panic(err)
} }
} }