You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-scm/scm/driver/azure/util.go

24 lines
499 B
Go

// Copyright 2017 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package azure
import (
"net/url"
"strconv"
"git.awesome-for.me/liuzhiguo/go-scm/scm"
)
func encodeListOptions(opts scm.ListOptions) string {
params := url.Values{}
if opts.Page != 0 {
params.Set("page", strconv.Itoa(opts.Page))
}
if opts.Size != 0 {
params.Set("per_page", strconv.Itoa(opts.Size))
}
return params.Encode()
}