Fix setDefaults (#508)

close one issue of #507

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/508
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
This commit is contained in:
6543 2021-03-30 04:57:07 +08:00 committed by John Olheiser
parent 4fac753f78
commit 120aa6234e

View file

@ -26,7 +26,8 @@ func (o ListOptions) getURLQuery() url.Values {
return query
}
func (o ListOptions) setDefaults() {
// setDefaults set default pagination options if none or wrong are set
func (o *ListOptions) setDefaults() {
if o.Page < 1 {
o.Page = 1
}