From 199451ce24c3f11338d6f3d1ea3028519932587f Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 21 Mar 2022 19:13:20 -0700 Subject: [PATCH] corrected typos (#131) * corrected typos * updated readme * corrected more typos * updated the readme migration --- v2/README.md | 27 ++++++++++++++++++---- v2/client.go | 38 +++++++++++++++---------------- v2/client_compliance_jobs_test.go | 12 +++++----- v2/client_likes_test.go | 4 ++-- v2/client_mutes_test.go | 16 ++++++------- v2/client_space_lookup_test.go | 8 +++---- v2/client_user_following_test.go | 4 ++-- v2/common_obj.go | 2 +- v2/endpoints.go | 6 ++--- v2/list_lookup.go | 4 ++-- v2/list_manage.go | 2 +- v2/tweet_obj.go | 4 ++-- v2/tweet_search.go | 6 ++--- v2/tweet_stream.go | 6 ++--- v2/user_likes.go | 4 ++-- v2/user_raw.go | 6 ++--- 16 files changed, 84 insertions(+), 65 deletions(-) diff --git a/v2/README.md b/v2/README.md index a8c8810..116ecc5 100644 --- a/v2/README.md +++ b/v2/README.md @@ -7,7 +7,7 @@ > It seems like every v1 is just a prototype. -One of my co-workers said that when we were working on a project, released the first version and then realizing that there were many improvements that needed to be done. That seems to ring true, and this library is not exception. When looking at the improvements that needed to be done, unfortunately these improvements will introduce breaking changes. This version will focus on giving the caller more information from the callouts to allow for better response handling. Another factor is to think about improvements, but first delivering the information first then providing more funcitonality second. +One of my co-workers said that when we were working on a project, released the first version and then realizing that there were many improvements that needed to be done. That seems to ring true, and this library is not exception. When looking at the improvements that needed to be done, unfortunately these improvements will introduce breaking changes. This version will focus on giving the caller more information from the callouts to allow for better response handling. Another factor is to think about improvements, but first delivering the information first then providing more functionality second. There will be `beta` releases throughout this process and if there are any new functionality requested, it will be discussed to try and get it into this version. Version 1 will still be maintained as I believe that version 2 will need to be mature before the pervious version is even considered to be sunset. @@ -19,7 +19,7 @@ go get -u github.com/g8rswimmer/go-twitter/v2 ## Changes The following are changes between `v1` and `v2` of the library. -* One structure for all endpoint callouts. In `v1` there were two structures, `Tweet` and `User`, to preform callouts. This required management of two structures and knowledge which structure contained the desired method callouts. At the time, the grouping looked logical. However with the addtion of the timeline endpoints, it makes more sense to have a single struture `Client` to handle all of the callouts. If the user would like to separate the functionality, interfaces can be used to achieve this. +* One structure for all endpoint callouts. In `v1` there were two structures, `Tweet` and `User`, to preform callouts. This required management of two structures and knowledge which structure contained the desired method callouts. At the time, the grouping looked logical. However with the addition of the timeline endpoints, it makes more sense to have a single structure `Client` to handle all of the callouts. If the user would like to separate the functionality, interfaces can be used to achieve this. * Endpoint methods will return the entire response. One of the major drawbacks of `v1` was the object returned was not the entire response sent by the callout. For example, the `errors` object in the response is included in `v1` response which does not allow the caller to properly handle partial errors. In `v2`, the first focus is to return the response from twitter to allow the caller to use it as they see fit. However, it does not mean that methods can not be added to the response object to provide groupings, etc. ### Breaking Changes @@ -47,6 +47,25 @@ These are some breaking changes and what release they are from. These type of c ``` UserRetweetLookuoOpts -> UserRetweetLookupOpts ``` +#### v2.0.0-beta16 +* There was a typo in the user following metadata. +``` +UserFollowinghMeta -> UserFollowingMeta +``` +* There was a typo in the delete user likes response +``` +DeteleUserLikesResponse -> DeleteUserLikesResponse +``` +* There was a typo in the `EntityURLObj` +``` +EntityURLObj.Desription -> EntityURLObj.Description +``` +* There was a typo in the `TweetObj` and the JSON tag +``` +TweetObj.PossibySensitive -> TweetObj.PossiblySensitive + +json: possiby_sensitive -> possibly_sensitive +``` ## Features Here are the current twitter `v2` API features supported. @@ -99,7 +118,7 @@ With each response, the rate limits from the response header is returned. This There is an example of rate limiting from a response [here](./_examples/misc/rate-limit/main.go). -This is an example of a twitter callout and if the limits have been reached, then it will backoff and try again. +This is an example of a twitter callout and if the limits have been reached, then it will back off and try again. ```go func TweetLikes(ctx context.Context, id string, client *twitter.Client) (*twitter.TweetLikesLookupResponse, error) { var er *ErrorResponse @@ -118,7 +137,7 @@ func TweetLikes(ctx context.Context, id string, client *twitter.Client) (*twitte ``` ## Examples -Much like `v1`, there is an `_example` directory to demostrate library usage. +Much like `v1`, there is an `_example` directory to demonstrate library usage. ## Simple Usage ```go diff --git a/v2/client.go b/v2/client.go index fd22296..4f1a916 100644 --- a/v2/client.go +++ b/v2/client.go @@ -1072,20 +1072,20 @@ func (c *Client) TweetAllCounts(ctx context.Context, query string, opts TweetAll return nil, e } - allCnts := &TweetAllCountsResponse{ + allCounts := &TweetAllCountsResponse{ TweetCounts: []*TweetCount{}, Meta: &TweetAllCountsMeta{}, } - if err := decoder.Decode(allCnts); err != nil { + if err := decoder.Decode(allCounts); err != nil { return nil, &ResponseDecodeError{ Name: "tweet all counts", Err: err, RateLimit: rl, } } - allCnts.RateLimit = rl - return allCnts, nil + allCounts.RateLimit = rl + return allCounts, nil } // UserFollowingLookup will return a user's following users @@ -1133,7 +1133,7 @@ func (c *Client) UserFollowingLookup(ctx context.Context, id string, opts UserFo followingLookup := &UserFollowingLookupResponse{ Raw: &UserRaw{}, - Meta: &UserFollowinghMeta{}, + Meta: &UserFollowingMeta{}, } if err := json.Unmarshal(respBytes, followingLookup.Raw); err != nil { @@ -1219,7 +1219,7 @@ func (c *Client) UserFollows(ctx context.Context, userID, targetUserID string) ( return raw, nil } -// DeleteUserFollows llows a user ID to unfollow another user +// DeleteUserFollows allows a user ID to unfollow another user func (c *Client) DeleteUserFollows(ctx context.Context, userID, targetUserID string) (*UserDeleteFollowsResponse, error) { switch { case len(userID) == 0: @@ -1853,7 +1853,7 @@ func (c *Client) UserMutesLookup(ctx context.Context, userID string, opts UserMu default: } - req, err := http.NewRequestWithContext(ctx, http.MethodGet, userMutesEndpont.urlID(c.Host, userID), nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, userMutesEndpoint.urlID(c.Host, userID), nil) if err != nil { return nil, fmt.Errorf("user muted lookup request: %w", err) } @@ -1933,7 +1933,7 @@ func (c *Client) UserMutes(ctx context.Context, userID, targetUserID string) (*U if err != nil { return nil, fmt.Errorf("user mutes: json marshal %w", err) } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, userMutesEndpont.urlID(c.Host, userID), bytes.NewReader(enc)) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, userMutesEndpoint.urlID(c.Host, userID), bytes.NewReader(enc)) if err != nil { return nil, fmt.Errorf("user mutes request: %w", err) } @@ -1988,7 +1988,7 @@ func (c *Client) DeleteUserMutes(ctx context.Context, userID, targetUserID strin default: } - ep := userMutesEndpont.urlID(c.Host, userID) + "/" + targetUserID + ep := userMutesEndpoint.urlID(c.Host, userID) + "/" + targetUserID req, err := http.NewRequestWithContext(ctx, http.MethodDelete, ep, nil) if err != nil { return nil, fmt.Errorf("user delete mutes request: %w", err) @@ -2101,7 +2101,7 @@ func (c *Client) TweetLikesLookup(ctx context.Context, tweetID string, opts Twee }, nil } -// UserLikesLookup gets informaiton about a user's liked tweets. +// UserLikesLookup gets information about a user's liked tweets. func (c *Client) UserLikesLookup(ctx context.Context, userID string, opts UserLikesLookupOpts) (*UserLikesLookupResponse, error) { switch { case len(userID) == 0: @@ -2233,7 +2233,7 @@ func (c *Client) UserLikes(ctx context.Context, userID, tweetID string) (*UserLi } // DeleteUserLikes will unlike the targeted tweet -func (c *Client) DeleteUserLikes(ctx context.Context, userID, tweetID string) (*DeteleUserLikesResponse, error) { +func (c *Client) DeleteUserLikes(ctx context.Context, userID, tweetID string) (*DeleteUserLikesResponse, error) { switch { case len(userID) == 0: return nil, fmt.Errorf("user delete likes: user id is required %w", ErrParameter) @@ -2275,7 +2275,7 @@ func (c *Client) DeleteUserLikes(ctx context.Context, userID, tweetID string) (* return nil, e } - raw := &DeteleUserLikesResponse{} + raw := &DeleteUserLikesResponse{} if err := decoder.Decode(raw); err != nil { return nil, &ResponseDecodeError{ Name: "delete user likes", @@ -2645,7 +2645,7 @@ func (c *Client) UpdateList(ctx context.Context, listID string, update ListMetaD return respBody, nil } -// DeleteList anables the authenticated user to delete a list +// DeleteList enables the authenticated user to delete a list func (c *Client) DeleteList(ctx context.Context, listID string) (*ListDeleteResponse, error) { switch { case len(listID) == 0: @@ -2759,7 +2759,7 @@ func (c *Client) AddListMember(ctx context.Context, listID, userID string) (*Lis if err := decoder.Decode(respBody); err != nil { return nil, &ResponseDecodeError{ - Name: "add list memeber", + Name: "add list member", Err: err, RateLimit: rl, } @@ -2815,7 +2815,7 @@ func (c *Client) RemoveListMember(ctx context.Context, listID, userID string) (* if err := decoder.Decode(respBody); err != nil { return nil, &ResponseDecodeError{ - Name: "remove list memeber", + Name: "remove list member", Err: err, RateLimit: rl, } @@ -3490,7 +3490,7 @@ func (c *Client) SpacesByCreatorLookup(ctx context.Context, userIDs []string, op default: } - req, err := http.NewRequestWithContext(ctx, http.MethodGet, spaceByCreatorLookupEndpont.url(c.Host), nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, spaceByCreatorLookupEndpoint.url(c.Host), nil) if err != nil { return nil, fmt.Errorf("space by creator lookup request: %w", err) } @@ -3748,7 +3748,7 @@ func (c *Client) CreateComplianceBatchJob(ctx context.Context, jobType Complianc return nil, fmt.Errorf("create compliance batch job request encode: %w", err) } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, complainceJobsEndpont.url(c.Host), bytes.NewReader(enc)) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, complianceJobsEndpiont.url(c.Host), bytes.NewReader(enc)) if err != nil { return nil, fmt.Errorf("create compliance batch job request: %w", err) } @@ -3805,7 +3805,7 @@ func (c *Client) ComplianceBatchJob(ctx context.Context, id string) (*Compliance default: } - ep := complainceJobsEndpont.url(c.Host) + "/" + id + ep := complianceJobsEndpiont.url(c.Host) + "/" + id req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("compliance batch job request: %w", err) @@ -3862,7 +3862,7 @@ func (c *Client) ComplianceBatchJobLookup(ctx context.Context, jobType Complianc default: } - ep := complainceJobsEndpont.url(c.Host) + ep := complianceJobsEndpiont.url(c.Host) req, err := http.NewRequestWithContext(ctx, http.MethodGet, ep, nil) if err != nil { return nil, fmt.Errorf("compliance batch job lookup request: %w", err) diff --git a/v2/client_compliance_jobs_test.go b/v2/client_compliance_jobs_test.go index cca2c3b..da646ea 100644 --- a/v2/client_compliance_jobs_test.go +++ b/v2/client_compliance_jobs_test.go @@ -36,8 +36,8 @@ func TestClient_CreateComplianceBatchJob(t *testing.T) { if req.Method != http.MethodPost { log.Panicf("the method is not correct %s %s", req.Method, http.MethodPost) } - if strings.Contains(req.URL.String(), string(complainceJobsEndpont)) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), complainceJobsEndpont) + if strings.Contains(req.URL.String(), string(complianceJobsEndpiont)) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), complianceJobsEndpiont) } body := `{ "data": { @@ -140,8 +140,8 @@ func TestClient_ComplianceBatchJob(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), string(complainceJobsEndpont)+"/job-id") == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), complainceJobsEndpont) + if strings.Contains(req.URL.String(), string(complianceJobsEndpiont)+"/job-id") == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), complianceJobsEndpiont) } body := `{ "data": { @@ -243,8 +243,8 @@ func TestClient_ComplianceBatchJobLookup(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), string(complainceJobsEndpont)) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), complainceJobsEndpont) + if strings.Contains(req.URL.String(), string(complianceJobsEndpiont)) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), complianceJobsEndpiont) } body := `{ "data": [ diff --git a/v2/client_likes_test.go b/v2/client_likes_test.go index dd039e9..16f7020 100644 --- a/v2/client_likes_test.go +++ b/v2/client_likes_test.go @@ -648,7 +648,7 @@ func TestClient_DeleteUserLikes(t *testing.T) { name string fields fields args args - want *DeteleUserLikesResponse + want *DeleteUserLikesResponse wantErr bool }{ { @@ -685,7 +685,7 @@ func TestClient_DeleteUserLikes(t *testing.T) { userID: "user-1234", tweetID: "tweet-1234", }, - want: &DeteleUserLikesResponse{ + want: &DeleteUserLikesResponse{ Data: &UserLikesData{ Liked: false, }, diff --git a/v2/client_mutes_test.go b/v2/client_mutes_test.go index 1b9c86d..4227fc6 100644 --- a/v2/client_mutes_test.go +++ b/v2/client_mutes_test.go @@ -36,8 +36,8 @@ func TestClient_UserMutesLookup(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), userMutesEndpont.urlID("", "2244994945")) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpont) + if strings.Contains(req.URL.String(), userMutesEndpoint.urlID("", "2244994945")) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpoint) } body := `{ "data": [ @@ -117,8 +117,8 @@ func TestClient_UserMutesLookup(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), userMutesEndpont.urlID("", "2244994945")) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpont) + if strings.Contains(req.URL.String(), userMutesEndpoint.urlID("", "2244994945")) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpoint) } body := `{ "data": [ @@ -305,8 +305,8 @@ func TestClient_UserMutes(t *testing.T) { if req.Method != http.MethodPost { log.Panicf("the method is not correct %s %s", req.Method, http.MethodPost) } - if strings.Contains(req.URL.String(), userMutesEndpont.urlID("", "6253282")) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpont) + if strings.Contains(req.URL.String(), userMutesEndpoint.urlID("", "6253282")) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpoint) } body := `{ "data": { @@ -388,8 +388,8 @@ func TestClient_DeleteUserMutes(t *testing.T) { if req.Method != http.MethodDelete { log.Panicf("the method is not correct %s %s", req.Method, http.MethodPost) } - if strings.Contains(req.URL.String(), userMutesEndpont.urlID("", "6253282")+"/2244994945") == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpont) + if strings.Contains(req.URL.String(), userMutesEndpoint.urlID("", "6253282")+"/2244994945") == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), userMutesEndpoint) } body := `{ "data": { diff --git a/v2/client_space_lookup_test.go b/v2/client_space_lookup_test.go index 1e9932e..400da8d 100644 --- a/v2/client_space_lookup_test.go +++ b/v2/client_space_lookup_test.go @@ -236,8 +236,8 @@ func TestClient_SpacesByCreatorLookup(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), string(spaceByCreatorLookupEndpont)) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), spaceByCreatorLookupEndpont) + if strings.Contains(req.URL.String(), string(spaceByCreatorLookupEndpoint)) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), spaceByCreatorLookupEndpoint) } body := `{ "data": [ @@ -295,8 +295,8 @@ func TestClient_SpacesByCreatorLookup(t *testing.T) { if req.Method != http.MethodGet { log.Panicf("the method is not correct %s %s", req.Method, http.MethodGet) } - if strings.Contains(req.URL.String(), string(spaceByCreatorLookupEndpont)) == false { - log.Panicf("the url is not correct %s %s", req.URL.String(), spaceByCreatorLookupEndpont) + if strings.Contains(req.URL.String(), string(spaceByCreatorLookupEndpoint)) == false { + log.Panicf("the url is not correct %s %s", req.URL.String(), spaceByCreatorLookupEndpoint) } body := `{ "data": [ diff --git a/v2/client_user_following_test.go b/v2/client_user_following_test.go index 6a8d744..543566b 100644 --- a/v2/client_user_following_test.go +++ b/v2/client_user_following_test.go @@ -88,7 +88,7 @@ func TestClient_UserFollowingLookup(t *testing.T) { }, }, }, - Meta: &UserFollowinghMeta{ + Meta: &UserFollowingMeta{ ResultCount: 2, NextToken: "DFEDBNRFT3MHCZZZ", }, @@ -212,7 +212,7 @@ func TestClient_UserFollowingLookup(t *testing.T) { }, }, }, - Meta: &UserFollowinghMeta{ + Meta: &UserFollowingMeta{ ResultCount: 2, NextToken: "DFEDBNRFT3MHCZZZ", }, diff --git a/v2/common_obj.go b/v2/common_obj.go index 4fe428a..5fa955a 100644 --- a/v2/common_obj.go +++ b/v2/common_obj.go @@ -31,7 +31,7 @@ type EntityURLObj struct { DisplayURL string `json:"display_url"` Status int `json:"status"` Title string `json:"title"` - Desription string `json:"description"` + Description string `json:"description"` UnwoundURL string `json:"unwound_url"` } diff --git a/v2/endpoints.go b/v2/endpoints.go index 7a7c72b..687f954 100644 --- a/v2/endpoints.go +++ b/v2/endpoints.go @@ -16,7 +16,7 @@ const ( userAuthLookupEndpoint endpoint = "2/users/me" userManageRetweetEndpoint endpoint = "2/users/{id}/retweets" userBlocksEndpoint endpoint = "2/users/{id}/blocking" - userMutesEndpont endpoint = "2/users/{id}/muting" + userMutesEndpoint endpoint = "2/users/{id}/muting" userRetweetLookupEndpoint endpoint = "2/tweets/{id}/retweeted_by" tweetRecentSearchEndpoint endpoint = "2/tweets/search/recent" tweetSearchEndpoint endpoint = "2/tweets/search/all" @@ -45,11 +45,11 @@ const ( userFollowedListEndpoint endpoint = "2/users/{id}/followed_lists" listUserFollowersEndpoint endpoint = "2/lists/{id}/followers" spaceLookupEndpoint endpoint = "2/spaces" - spaceByCreatorLookupEndpont endpoint = "2/spaces/by/creator_ids" + spaceByCreatorLookupEndpoint endpoint = "2/spaces/by/creator_ids" spaceBuyersLookupEndpoint endpoint = "2/spaces/{id}/buyers" spaceTweetsLookupEndpoint endpoint = "2/spaces/{id}/tweets" spaceSearchEndpoint endpoint = "2/spaces/search" - complainceJobsEndpont endpoint = "2/compliance/jobs" + complianceJobsEndpiont endpoint = "2/compliance/jobs" idTag = "{id}" ) diff --git a/v2/list_lookup.go b/v2/list_lookup.go index cd350a2..fd57ede 100644 --- a/v2/list_lookup.go +++ b/v2/list_lookup.go @@ -85,7 +85,7 @@ type UserListRaw struct { Errors []*ErrorObj `json:"errors,omitempty"` } -// UserListLookupResponse is the raw ressponse with meta +// UserListLookupResponse is the raw response with meta type UserListLookupResponse struct { Raw *UserListRaw Meta *UserListLookupMeta `json:"meta"` @@ -278,7 +278,7 @@ type UserPinnedListsRaw struct { Errors []*ErrorObj `json:"errors,omitempty"` } -// UserPinnedListsMeta the meta for pinned lista +// UserPinnedListsMeta the meta for pinned lists type UserPinnedListsMeta struct { ResultCount int `json:"result_count"` } diff --git a/v2/list_manage.go b/v2/list_manage.go index 45cfdce..b1e4f55 100644 --- a/v2/list_manage.go +++ b/v2/list_manage.go @@ -69,7 +69,7 @@ type UserPinListResponse struct { RateLimit *RateLimit } -// UserUnpinListResponse upin list response +// UserUnpinListResponse unpin list response type UserUnpinListResponse struct { List *UserPinListData `json:"data"` RateLimit *RateLimit diff --git a/v2/tweet_obj.go b/v2/tweet_obj.go index ee7487a..da4204e 100644 --- a/v2/tweet_obj.go +++ b/v2/tweet_obj.go @@ -67,7 +67,7 @@ type TweetObj struct { Language string `json:"lang,omitempty"` NonPublicMetrics *TweetMetricsObj `json:"non_public_metrics,omitempty"` OrganicMetrics *TweetMetricsObj `json:"organic_metrics,omitempty"` - PossibySensitive bool `json:"possiby_sensitive,omitempty"` + PossiblySensitive bool `json:"possibly_sensitive,omitempty"` PromotedMetrics *TweetMetricsObj `json:"promoted_metrics,omitempty"` PublicMetrics *TweetMetricsObj `json:"public_metrics,omitempty"` ReferencedTweets []*TweetReferencedTweetObj `json:"referenced_tweets,omitempty"` @@ -87,7 +87,7 @@ type TweetContextAnnotationObj struct { Entity TweetContextObj `json:"entity"` } -// TweetContextObj contains the elements which identify detailed information regarding the domain classificaiton based on the Tweet text +// TweetContextObj contains the elements which identify detailed information regarding the domain classification based on the Tweet text type TweetContextObj struct { ID string `json:"id"` Name string `json:"name"` diff --git a/v2/tweet_search.go b/v2/tweet_search.go index e7dfa45..940bb3a 100644 --- a/v2/tweet_search.go +++ b/v2/tweet_search.go @@ -18,7 +18,7 @@ const ( TweetSearchSortOrderRelevancy TweetSearchSortOrder = "relevancy" ) -// TweetRecentSearchOpts are the optional parameters for the recent seach API +// TweetRecentSearchOpts are the optional parameters for the recent search API type TweetRecentSearchOpts struct { Expansions []Expansion MediaFields []MediaField @@ -166,7 +166,7 @@ type TweetSearchResponse struct { RateLimit *RateLimit } -// TweetSearchMeta is the tweet search metas +// TweetSearchMeta is the tweet search meta data type TweetSearchMeta struct { NewestID string `json:"newest_id"` OldestID string `json:"oldest_id"` @@ -249,7 +249,7 @@ type TweetSearchStreamAddRuleResponse struct { RateLimit *RateLimit } -// TweetSearchStreamDeleteRuleResponse is the respnse from deleting rules +// TweetSearchStreamDeleteRuleResponse is the response from deleting rules type TweetSearchStreamDeleteRuleResponse struct { Meta *TweetSearchStreamRuleMeta `json:"meta"` Errors []*ErrorObj `json:"errors,omitempty"` diff --git a/v2/tweet_stream.go b/v2/tweet_stream.go index 062893c..d5c23b6 100644 --- a/v2/tweet_stream.go +++ b/v2/tweet_stream.go @@ -30,7 +30,7 @@ const ( tweetStart = "data" keepAliveTO = 11 * time.Second - // TweetErrorType represents the tweet stream errrors + // TweetErrorType represents the tweet stream errors TweetErrorType StreamErrorType = "tweet" // SystemErrorType represents the system stream errors SystemErrorType StreamErrorType = "system" @@ -241,7 +241,7 @@ func (ts *TweetStream) handle(stream io.ReadCloser) { if err := json.Unmarshal(msg, single); err != nil { sErr := &StreamError{ Type: TweetErrorType, - Msg: "umarshal tweet stream", + Msg: "unmarshal tweet stream", Err: err, } select { @@ -271,7 +271,7 @@ func (ts *TweetStream) handle(stream io.ReadCloser) { if err := json.Unmarshal(msg, &sysMsg); err != nil { sErr := &StreamError{ Type: SystemErrorType, - Msg: "umarshal system stream", + Msg: "unmarshal system stream", Err: err, } select { diff --git a/v2/user_likes.go b/v2/user_likes.go index e170b88..8a2351e 100644 --- a/v2/user_likes.go +++ b/v2/user_likes.go @@ -12,8 +12,8 @@ type UserLikesResponse struct { RateLimit *RateLimit } -// DeteleUserLikesResponse the response for the user unlike -type DeteleUserLikesResponse struct { +// DeleteUserLikesResponse the response for the user unlike +type DeleteUserLikesResponse struct { Data *UserLikesData `json:"data"` RateLimit *RateLimit } diff --git a/v2/user_raw.go b/v2/user_raw.go index a6210b5..64cca77 100644 --- a/v2/user_raw.go +++ b/v2/user_raw.go @@ -32,12 +32,12 @@ type UserDeleteFollowsData struct { // UserFollowingLookupResponse is the response for the user following API type UserFollowingLookupResponse struct { Raw *UserRaw - Meta *UserFollowinghMeta `json:"meta"` + Meta *UserFollowingMeta `json:"meta"` RateLimit *RateLimit } -// UserFollowinghMeta is the meta data returned by the user following API -type UserFollowinghMeta struct { +// UserFollowingMeta is the meta data returned by the user following API +type UserFollowingMeta struct { ResultCount int `json:"result_count"` NextToken string `json:"next_token"` PreviousToken string `json:"previous_token"`