From b105e8554c1ad0b8dab958dee2f94b40a5db0928 Mon Sep 17 00:00:00 2001 From: TSUYUSATO Kitsune Date: Wed, 19 Apr 2017 19:12:09 +0900 Subject: [PATCH] Remove 'go' from calling 'cancel' https://github.com/mattn/go-mastodon/pull/28#discussion_r112162740 --- apps_test.go | 2 +- mastodon_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps_test.go b/apps_test.go index 7848e0e..d88ff4b 100644 --- a/apps_test.go +++ b/apps_test.go @@ -52,7 +52,7 @@ func TestRegisterAppWithCancel(t *testing.T) { defer ts.Close() ctx, cancel := context.WithCancel(context.Background()) - go cancel() + cancel() _, err := RegisterApp(ctx, &AppConfig{ Server: ts.URL, Scopes: "read write follow", diff --git a/mastodon_test.go b/mastodon_test.go index 69c93c4..745febe 100644 --- a/mastodon_test.go +++ b/mastodon_test.go @@ -56,7 +56,7 @@ func TestAuthenticateWithCancel(t *testing.T) { ClientSecret: "bar", }) ctx, cancel := context.WithCancel(context.Background()) - go cancel() + cancel() err := client.Authenticate(ctx, "invalid", "user") if err == nil { t.Fatalf("should be fail: %v", err) @@ -116,7 +116,7 @@ func TestPostStatusWithCancel(t *testing.T) { ClientSecret: "bar", }) ctx, cancel := context.WithCancel(context.Background()) - go cancel() + cancel() _, err := client.PostStatus(ctx, &Toot{ Status: "foobar", }) @@ -182,7 +182,7 @@ func TestGetTimelineHomeWithCancel(t *testing.T) { AccessToken: "zoo", }) ctx, cancel := context.WithCancel(context.Background()) - go cancel() + cancel() _, err := client.GetTimelineHome(ctx) if err == nil { t.Fatalf("should be fail: %v", err)