Skip to content

Commit 24294c1

Browse files
committed
Fix handling of Skip and Start parameters
The way we treated Skip and Start parameters was inconsistent and wrong. In some calls we send both parameters (s, start, S). This causes and undefined behaviour at Gerrit itself. Additional the Skip/Start parameters are numbers and not strings. Here we fixed the Go types. Thanks a lot to @michaeldorner for his initial work in #48 Related: - #48
1 parent 8eb1af8 commit 24294c1

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

changes.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,7 @@ type QueryOptions struct {
518518
type QueryChangeOptions struct {
519519
QueryOptions
520520

521-
// The S or start query parameter can be supplied to skip a number of changes from the list.
522-
Skip int `url:"S,omitempty"`
521+
// The `S` or `start` query parameter can be supplied to skip a number of changes from the list.
523522
Start int `url:"start,omitempty"`
524523

525524
ChangeOptions

projects.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ type ProjectBaseOptions struct {
170170
// Limit the number of projects to be included in the results.
171171
Limit int `url:"n,omitempty"`
172172

173-
// Skip the given number of branches from the beginning of the list.
174-
Skip string `url:"s,omitempty"`
173+
// Skip the given number of tags from the beginning of the list.
174+
Skip int `url:"S,omitempty"`
175175
}
176176

177177
// ProjectOptions specifies the parameters to the ProjectsService.ListProjects.
@@ -192,9 +192,6 @@ type ProjectOptions struct {
192192
// For example: the regex 'test.*' will match any projects that start with 'test' and regex '.*test' will match any project that end with 'test'.
193193
Regex string `url:"r,omitempty"`
194194

195-
// Skip the given number of projects from the beginning of the list.
196-
Skip string `url:"S,omitempty"`
197-
198195
// Limit the results to those projects that match the specified substring.
199196
Substring string `url:"m,omitempty"`
200197

projects_branch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type BranchOptions struct {
3232
Limit int `url:"n,omitempty"`
3333

3434
// Skip the given number of branches from the beginning of the list.
35-
Skip string `url:"s,omitempty"`
35+
Skip int `url:"S,omitempty"`
3636

3737
// Substring limits the results to those projects that match the specified substring.
3838
Substring string `url:"m,omitempty"`

0 commit comments

Comments
 (0)