Skip to content

Commit

Permalink
Task/issue 85 typo (#110)
Browse files Browse the repository at this point in the history
* corrected a typo

* fixed the typo
  • Loading branch information
g8rswimmer authored Feb 26, 2022
1 parent 24d5964 commit 1eeea95
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ These are some breaking changes and what release they are from. These type of c
// handle error
}
```
#### v2.0.0-beta13
* There was a typo in the user retweet lookup options and it was corrected.
```
UserRetweetLookuoOpts -> UserRetweetLookupOpts
```

## Features
Here are the current twitter `v2` API features supported:
Expand Down
2 changes: 1 addition & 1 deletion v2/_examples/user-retweet-lookup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
Client: http.DefaultClient,
Host: "https://api.twitter.com",
}
opts := twitter.UserRetweetLookuoOpts{
opts := twitter.UserRetweetLookupOpts{
Expansions: []twitter.Expansion{twitter.ExpansionPinnedTweetID},
}

Expand Down
2 changes: 1 addition & 1 deletion v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (c *Client) UserLookup(ctx context.Context, ids []string, opts UserLookupOp
}

// UserRetweetLookup allows you to get information about users that have retweeted a tweet
func (c *Client) UserRetweetLookup(ctx context.Context, tweetID string, opts UserRetweetLookuoOpts) (*UserRetweetLookupResponse, error) {
func (c *Client) UserRetweetLookup(ctx context.Context, tweetID string, opts UserRetweetLookupOpts) (*UserRetweetLookupResponse, error) {
switch {
case len(tweetID) == 0:
return nil, fmt.Errorf("user retweet lookup: an id is required: %w", ErrParameter)
Expand Down
4 changes: 2 additions & 2 deletions v2/client_retweet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func TestClient_UserRetweetLookup(t *testing.T) {
}
type args struct {
tweetID string
opts UserRetweetLookuoOpts
opts UserRetweetLookupOpts
}
tests := []struct {
name string
Expand Down Expand Up @@ -391,7 +391,7 @@ func TestClient_UserRetweetLookup(t *testing.T) {
},
args: args{
tweetID: "tweet-1234",
opts: UserRetweetLookuoOpts{
opts: UserRetweetLookupOpts{
Expansions: []Expansion{ExpansionPinnedTweetID},
UserFields: []UserField{UserFieldCreatedAt, UserFieldDescription},
TweetFields: []TweetField{TweetFieldCreatedAt},
Expand Down
6 changes: 3 additions & 3 deletions v2/user_retweet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ type UserRetweetRawIncludes struct {
Tweets []*TweetObj `json:"tweets,omitempty"`
}

// UserRetweetLookuoOpts are the options for the user retweet loopup
type UserRetweetLookuoOpts struct {
// UserRetweetLookupOpts are the options for the user retweet loopup
type UserRetweetLookupOpts struct {
Expansions []Expansion
TweetFields []TweetField
UserFields []UserField
Expand All @@ -56,7 +56,7 @@ type UserRetweetLookuoOpts struct {
PollFields []PollField
}

func (u UserRetweetLookuoOpts) addQuery(req *http.Request) {
func (u UserRetweetLookupOpts) addQuery(req *http.Request) {
q := req.URL.Query()
if len(u.Expansions) > 0 {
q.Add("expansions", strings.Join(expansionStringArray(u.Expansions), ","))
Expand Down

0 comments on commit 1eeea95

Please sign in to comment.