From 245a033456b33f3d52bdcdebf0fc4416289e03db Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 21 Feb 2017 20:27:01 +0100 Subject: [PATCH] fix api breaking of google/go-github google/go-github broke the api of their functions with https://github.com/google/go-github/commit/23d6cb9cacb5aa314e93d600fe20a48496a718d4 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 --- util/upgrade.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/upgrade.go b/util/upgrade.go index c51b30ad..49a964bf 100644 --- a/util/upgrade.go +++ b/util/upgrade.go @@ -10,6 +10,7 @@ import ( "path/filepath" "runtime" "time" + "context" "github.com/google/go-github/github" ) @@ -96,7 +97,7 @@ func findAsset(release *github.RepositoryRelease) *github.ReleaseAsset { func CheckUpdate(version string) error { // fetch releases 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 { return err }