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