Commit 6094b88c authored by Carlos C's avatar Carlos C Committed by Brad Fitzpatrick

net/url: add example to URL.ResolveReference

Change-Id: I9db1997b8dc7e06e9d124753ead6221470a1edf9
Reviewed-on: https://go-review.googlesource.com/12254Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 6163cf87
......@@ -84,3 +84,17 @@ func ExampleURL_opaque() {
// Accept-Encoding: gzip
//
}
func ExampleURL_ResolveReference() {
u, err := url.Parse("../../..//search?q=dotnet")
if err != nil {
log.Fatal(err)
}
base, err := url.Parse("http://example.com/directory/")
if err != nil {
log.Fatal(err)
}
fmt.Println(base.ResolveReference(u))
// Output:
// http://example.com/search?q=dotnet
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment