Merge remote-tracking branch 'master/master' into pr/1

# Conflicts:
#	go.mod
This commit is contained in:
tolantop 2020-03-04 11:19:13 +03:00
commit fcb4411c18
4 changed files with 4 additions and 4 deletions

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/tolantop/twitter-scraper
module github.com/n0madic/twitter-scraper
go 1.13

View file

@ -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)
}
}

View file

@ -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

View file

@ -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