diff --git a/changes.go b/changes.go index d7da52d..301aafd 100644 --- a/changes.go +++ b/changes.go @@ -364,7 +364,7 @@ type QueryOptions struct { type QueryChangeOptions struct { QueryOptions - // The S or start query parameter can be supplied to skip a number of changes from the list. + // The S or start query parameter can be supplied to skip a number of changes from the list. Only one of the two parameters can be set at a time. Skip int `url:"S,omitempty"` Start int `url:"start,omitempty"` @@ -391,6 +391,10 @@ type ChangeOptions struct { func (s *ChangesService) QueryChanges(opt *QueryChangeOptions) (*[]ChangeInfo, *Response, error) { u := "changes/" + if !(opt.Skip == opt.Start || opt.Skip == 0 || opt.Start == 0) { + return nil, nil, fmt.Errorf("the query parameters `skip`/`S`(=%v) and `start` (=%v) are conflicting", opt.Skip, opt.Start) + } + u, err := addOptions(u, opt) if err != nil { return nil, nil, err diff --git a/projects.go b/projects.go index 5695c6b..1541087 100644 --- a/projects.go +++ b/projects.go @@ -171,7 +171,7 @@ type ProjectBaseOptions struct { Limit int `url:"n,omitempty"` // Skip the given number of branches from the beginning of the list. - Skip string `url:"s,omitempty"` + Skip string `url:"S,omitempty"` } // ProjectOptions specifies the parameters to the ProjectsService.ListProjects. @@ -193,7 +193,7 @@ type ProjectOptions struct { Regex string `url:"r,omitempty"` // Skip the given number of projects from the beginning of the list. - Skip string `url:"S,omitempty"` + Start string `url:"start,omitempty"` // Limit the results to those projects that match the specified substring. Substring string `url:"m,omitempty"` diff --git a/projects_branch.go b/projects_branch.go index 66d8ba8..6fe3de9 100644 --- a/projects_branch.go +++ b/projects_branch.go @@ -32,7 +32,7 @@ type BranchOptions struct { Limit int `url:"n,omitempty"` // Skip the given number of branches from the beginning of the list. - Skip string `url:"s,omitempty"` + Skip string `url:"S,omitempty"` // Substring limits the results to those projects that match the specified substring. Substring string `url:"m,omitempty"`