go-twitch/api/endpoint/endpoint.go

20 lines
326 B
Go
Raw Permalink Normal View History

package endpoint
import (
"net/url"
"strings"
)
func Make(baseUrl *url.URL, path string, vals ...url.Values) string {
var sb strings.Builder
sb.WriteString(baseUrl.String())
sb.WriteString("/")
sb.WriteString(path)
if len(vals) > 0 {
sb.WriteString("?")
sb.WriteString(vals[0].Encode())
}
return sb.String()
}