(fullBaseUrl string, relativeUrl ...string)
| 27 | } |
| 28 | |
| 29 | func JoinUrls(fullBaseUrl string, relativeUrl ...string) (string, error) { |
| 30 | parsedBase, err := url.Parse(fullBaseUrl) |
| 31 | if err != nil { |
| 32 | return "", err |
| 33 | } |
| 34 | return JoinUrlsParsed(parsedBase, relativeUrl...) |
| 35 | } |
| 36 | |
| 37 | func JoinUrlsParsed(parsedBase *url.URL, relativeUrl ...string) (string, error) { |
| 38 | parsedRelative, err := url.Parse(path.Join(relativeUrl...)) |
no test coverage detected