| Index: go/rietveld/rietveld.go
|
| diff --git a/go/rietveld/rietveld.go b/go/rietveld/rietveld.go
|
| index 0c3bfeb34ee7e6b82961ea13b7c709e0347d2a33..227d001d504554ba982683e1b3400378c84e6991 100644
|
| --- a/go/rietveld/rietveld.go
|
| +++ b/go/rietveld/rietveld.go
|
| @@ -19,6 +19,7 @@ import (
|
| var (
|
| committedIssueRegexp []string = []string{
|
| "Committed patchset #[0-9]+ \\((id:)?[0-9]+\\) as [0-9a-f]{2,40}",
|
| + "Committed patchset #[0-9]+",
|
| "Change committed as [0-9]+",
|
| }
|
| )
|
| @@ -114,16 +115,9 @@ func SearchOpen(open bool) *SearchTerm {
|
| }
|
| }
|
|
|
| -func SearchLimit(limit int) *SearchTerm {
|
| - return &SearchTerm{
|
| - Key: "limit",
|
| - Value: fmt.Sprintf("%d", limit),
|
| - }
|
| -}
|
| -
|
| // Search returns a slice of Issues which fit the given criteria.
|
| -func (r Rietveld) Search(terms ...*SearchTerm) ([]*Issue, error) {
|
| - searchUrl := "/search?format=json"
|
| +func (r Rietveld) Search(limit int, terms ...*SearchTerm) ([]*Issue, error) {
|
| + searchUrl := fmt.Sprintf("/search?format=json&limit=%d", limit)
|
| for _, term := range terms {
|
| searchUrl += fmt.Sprintf("&%s=%s", term.Key, term.Value)
|
| }
|
| @@ -166,6 +160,9 @@ func (r Rietveld) Search(terms ...*SearchTerm) ([]*Issue, error) {
|
| issues = append(issues, &fullIssue)
|
| }
|
| }
|
| + if len(issues) >= limit {
|
| + break
|
| + }
|
| cursor = "&cursor=" + data.Cursor
|
| }
|
| sort.Sort(issues)
|
|
|