1
在下面的example中,結尾的URL /
被刪除,有沒有辦法保留/
?如何避免當在解析引用中去掉URL斜槓結尾
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))
}
輸出:
http://localhost:5100/hello