add String() function to Game
This commit is contained in:
parent
b99d855805
commit
c3a9b25af4
@ -1,6 +1,7 @@
|
|||||||
package football
|
package football
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.lehouerou.net/laurent/sorare/graphql"
|
"git.lehouerou.net/laurent/sorare/graphql"
|
||||||
@ -84,3 +85,14 @@ func (f *Football) NewClubGamesQuery(
|
|||||||
[]string{"football", "club(slug:$slug)"},
|
[]string{"football", "club(slug:$slug)"},
|
||||||
).WithQueryParam("slug", clubSlug)
|
).WithQueryParam("slug", clubSlug)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *Game) String() string {
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"%s | %s %d - %d %s",
|
||||||
|
g.Date.Format("2006-01-02"),
|
||||||
|
g.HomeTeam.Team.Slug,
|
||||||
|
g.HomeGoals,
|
||||||
|
g.AwayGoals,
|
||||||
|
g.AwayTeam.Team.Slug,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user