fix api breaking of google/go-github

google/go-github broke the api of their functions with 23d6cb9cac
This commit adds the context `context.TODO()` to the call of `gh.Repositories.ListReleases` which is meant to be used "when it's unclear which Context to use or it is not yet available (because the surrounding function has not yet been extended to accept a Context parameter)" (citing https://godoc.org/context)

Signed-off-by: julian <dev@jneureuther.de>
This commit is contained in:
julian 2017-02-21 20:27:01 +01:00
parent ce596b810d
commit 245a033456
No known key found for this signature in database
GPG Key ID: 357402CB98E4E500

View File

@ -10,6 +10,7 @@ import (
"path/filepath" "path/filepath"
"runtime" "runtime"
"time" "time"
"context"
"github.com/google/go-github/github" "github.com/google/go-github/github"
) )
@ -96,7 +97,7 @@ func findAsset(release *github.RepositoryRelease) *github.ReleaseAsset {
func CheckUpdate(version string) error { func CheckUpdate(version string) error {
// fetch releases // fetch releases
gh := github.NewClient(nil) gh := github.NewClient(nil)
releases, _, err := gh.Repositories.ListReleases("ansible-semaphore", "semaphore", nil) releases, _, err := gh.Repositories.ListReleases(context.TODO(), "ansible-semaphore", "semaphore", nil)
if err != nil { if err != nil {
return err return err
} }