In the following example, end of URL / is removed, is there a way to keep the /?
package main import ( "fmt" "net/url" "path" ) func main() { u, _ := url.Parse("http://localhost:5100") relative, _ := url.Parse(path.Join("hello/")) fmt.Println(u.ResolveReference(relative)) } Output:
http://localhost:5100/hello