Skip to content

tmbrggmn/pandascore-go

Repository files navigation

pandascore-go master codecov Go Report Card GoDoc

PandaScore client for Go.

Status

⚠️ This is still a new project and does not completely abstract all PandaScore APIs or games (yet). It also has a couple of open issues (see below).

Getting started

Installation

go get github.com/tmbrggmn/pandascore-go

Usage

TODO

Points of attention/improvement

  • Getting all pages from the PandaScore API has been implemented with by unmarshalling the results from all requests into a single array of map[string]interface{} to avoid having to use reflect to merge structs (see execution.go). Not sure if this is the best way to tackle this problem 🤷‍♂️

Integration tests

In order to run the integration tests you'll need to do 2 things:

  1. Add your on .env file to the root of the project
  2. Enable integration tests by enabling the integration build flag

To set the PandaScore access token, simple create a new .env file in the root of the project and add your PandaScore access token in the PANDASCORE_ACCESS_TOKEN variable. For example:

PANDASCORE_ACCESS_TOKEN=my_pandascore_access_token

Integration tests are marked with the integration build flag, so to run them we need to enable integration tests when running the test: go test -tags=integration