package handler import ( "net/http" "github.com/gin-gonic/gin" "github.com/iliadenisov/galaxy/internal/controller" "github.com/iliadenisov/galaxy/internal/game" "github.com/iliadenisov/galaxy/internal/model/rest" ) func StatusHandler(c *gin.Context, config controller.Config) { g, err := game.LoadState(config) if transformError(c, err) { return } c.JSON(http.StatusOK, rest.Status{ Turn: g.Age, Players: len(g.Race), }) }