knowyt/server/src/application/getGame.go

15 lines
231 B
Go
Raw Normal View History

2021-08-04 23:42:21 +00:00
package application
import (
"fmt"
"sirlab.de/go/knyt/game"
)
func (app Application) GetGameById(id string) (*game.Game, error) {
gm := app.games[id]
if gm == nil {
return nil, fmt.Errorf("unknown id")
}
return gm, nil
}