package utils

import (
	"net/url"
	"path"
)

func URLJoin(baseURL string, paths ...string) string {
	u, _ := url.Parse(baseURL)
	pathElements := append([]string{u.Path}, paths...)
	u.Path = path.Join(pathElements...)

	return u.String()
}
