package cardmarket import ( "context" ) type Game struct { GameID uint32 `json:"idGame"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` Links Links `json:"links"` } func (c *ApiClient) GetGames(ctx context.Context) ([]Game, error) { type responseBody struct { Game []Game `json:"game"` Links Links `json:"links"` } respBody := &responseBody{} if err := c.get(ctx, "/games", respBody); err != nil { return nil, err } return respBody.Game, nil }