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)