From 104cfd9f364a479f9deddb4d3424cebe946948ae Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Sat, 8 Apr 2023 09:40:15 +0700 Subject: [PATCH] fix typography errors (#84) --- ident/ident.go | 4 ++-- scalar.go | 2 +- subscription.go | 10 +++++----- subscription_test.go | 2 +- subscriptions_transport_ws_test.go | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ident/ident.go b/ident/ident.go index 29e498e..403ed84 100644 --- a/ident/ident.go +++ b/ident/ident.go @@ -118,7 +118,7 @@ func ParseScreamingSnakeCase(name string) Name { // Name is an identifier name, broken up into individual words. type Name []string -// ToMixedCaps expresses identifer name in MixedCaps naming convention. +// ToMixedCaps expresses identifier name in MixedCaps naming convention. // // E.g., "ClientMutationID". func (n Name) ToMixedCaps() string { @@ -141,7 +141,7 @@ func (n Name) ToMixedCaps() string { return strings.Join(n, "") } -// ToLowerCamelCase expresses identifer name in lowerCamelCase naming convention. +// ToLowerCamelCase expresses identifier name in lowerCamelCase naming convention. // // E.g., "clientMutationId". func (n Name) ToLowerCamelCase() string { diff --git a/scalar.go b/scalar.go index ffd8363..49c326b 100644 --- a/scalar.go +++ b/scalar.go @@ -5,7 +5,7 @@ import ( "reflect" ) -// Note: These custom types are kept for backwards compatability. Native +// Note: These custom types are kept for backwards compatibility. Native // types for queries and responses are supported, with the exception of the ID. type ( diff --git a/subscription.go b/subscription.go index 1eb12bb..0664590 100644 --- a/subscription.go +++ b/subscription.go @@ -34,8 +34,8 @@ const ( SubscriptionWaiting SubscriptionStatus = 0 // SubscriptionRunning the subscription is up and running SubscriptionRunning SubscriptionStatus = 1 - // SubscriptionUnsubcribed the subscription was manually unsubscribed by the user - SubscriptionUnsubcribed SubscriptionStatus = 2 + // SubscriptionUnsubscribed the subscription was manually unsubscribed by the user + SubscriptionUnsubscribed SubscriptionStatus = 2 // SubscriptionsTransportWS the enum implements the subscription transport that follows Apollo's subscriptions-transport-ws protocol specification // https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md @@ -668,14 +668,14 @@ func (sc *SubscriptionClient) Unsubscribe(id string) error { return fmt.Errorf("%s, %w", id, ErrSubscriptionNotExists) } - if sub.status == SubscriptionUnsubcribed { + if sub.status == SubscriptionUnsubscribed { return nil } var err error if sub.status == SubscriptionRunning { err = sc.protocol.Unsubscribe(ctx, *sub) } - sub.status = SubscriptionUnsubcribed + sub.status = SubscriptionUnsubscribed ctx.SetSubscription(sub.key, sub) sc.checkSubscriptionStatuses(ctx) @@ -821,7 +821,7 @@ func (sc *SubscriptionClient) reset() { for key, sub := range subContext.GetSubscriptions() { // remove subscriptions that are manually unsubscribed by the user - if sub.status == SubscriptionUnsubcribed { + if sub.status == SubscriptionUnsubscribed { continue } if sub.status == SubscriptionRunning { diff --git a/subscription_test.go b/subscription_test.go index 18d84c2..2e3b9b7 100644 --- a/subscription_test.go +++ b/subscription_test.go @@ -196,7 +196,7 @@ func TestSubscription_LifeCycleEvents(t *testing.T) { t.Fatalf("expected OnConnected event, got none") } if !wasDisconnected { - t.Fatalf("expected OnDisonnected event, got none") + t.Fatalf("expected OnDisconnected event, got none") } } diff --git a/subscriptions_transport_ws_test.go b/subscriptions_transport_ws_test.go index 096baf0..9baaa78 100644 --- a/subscriptions_transport_ws_test.go +++ b/subscriptions_transport_ws_test.go @@ -540,7 +540,7 @@ func TestTransportWS_ResetClient(t *testing.T) { time.Sleep(2 * time.Second) - // test susbcription ids + // test subscription ids sub1 := subscriptionClient.getContext().GetSubscription(subId1) if sub1 == nil { (*t).Fatalf("subscription 1 not found: %s", subId1)