mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 12:13:29 +02:00
9bcdcc128f
An empty stream isn't valid JSON, so we shouldn't silently ignore it.
18 lines
316 B
Go
18 lines
316 B
Go
package jira
|
|
|
|
import (
|
|
"fmt"
|
|
"net/url"
|
|
"path"
|
|
)
|
|
|
|
func URLJoin(endpoint string, paths ...string) string {
|
|
u, err := url.Parse(endpoint)
|
|
if err != nil {
|
|
panic(fmt.Errorf("unable to parse endpoint: %s", endpoint))
|
|
}
|
|
paths = append([]string{u.Path}, paths...)
|
|
u.Path = path.Join(paths...)
|
|
return u.String()
|
|
}
|