diff --git a/go.mod b/go.mod index 56ae14e..fc4b2c8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tolantop/twitter-scraper +module github.com/n0madic/twitter-scraper go 1.13 diff --git a/trends_test.go b/trends_test.go index 9f61445..ad0db70 100644 --- a/trends_test.go +++ b/trends_test.go @@ -11,6 +11,6 @@ func TestGetTrends(t *testing.T) { } if len(trends) != 10 { - t.Error("Expected 10 trends") + t.Errorf("Expected 10 trends, got %d: %#v", len(trends), trends) } } diff --git a/tweets.go b/tweets.go index 4cf5e42..222438b 100644 --- a/tweets.go +++ b/tweets.go @@ -46,7 +46,7 @@ type Result struct { // GetTweets returns channel with tweets for a given user func GetTweets(user string, pages int) <-chan *Result { - channel := make(chan *Result, 0) + channel := make(chan *Result) go func(user string) { defer close(channel) var lastTweetID string diff --git a/util.go b/util.go index 70d06a3..1d8bd26 100644 --- a/util.go +++ b/util.go @@ -26,7 +26,7 @@ func getHTMLFromJSON(req *http.Request, field string) (*strings.Reader, error) { htm, ok := ajaxJSON[field].(string) if !ok { - return nil, fmt.Errorf("filed not found in JSON") + return nil, fmt.Errorf("field not found in JSON") } return strings.NewReader(htm), nil