From 120aa6234edbb6041d0c0714620b80f8579629e3 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 30 Mar 2021 04:57:07 +0800 Subject: [PATCH] Fix setDefaults (#508) close one issue of #507 Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/508 Reviewed-by: Andrew Thornton Reviewed-by: John Olheiser Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de> --- gitea/list_options.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitea/list_options.go b/gitea/list_options.go index d56c651..12b7e8b 100644 --- a/gitea/list_options.go +++ b/gitea/list_options.go @@ -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 }