15 lines
231 B
Go
15 lines
231 B
Go
|
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
|
||
|
}
|