This is a function from the Anaconda Go package:
func (a TwitterApi) GetHomeTimeline(v url.Values) (timeline []Tweet, err error) {
if v == nil {
v = url.Values{}
}
if val := v.Get("include_entities"); val == "" {
v.Set("include_entities", "true")
}
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/statuses/home_timeline.json", v, &timeline, _GET, response_ch}
return timeline, (<-response_ch).err
}
When I call the function like this, it works fine:
result, _ := api.GetHomeTimeline(nil)
But now I want to change the argument from nil
into something else. In the example* this is set as:
v := url.Values{}
v.Set("count", "30")
result, _ := api.GetHomeTimeline(v)
But this generates the error: undefined: url in url.Values
*
- I've set the example to match my request.