Created
July 18, 2014 22:09
-
-
Save yifan-gu/3764a6d3d1a0e68d18c2 to your computer and use it in GitHub Desktop.
url escape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run testurlparse.go | |
$ url http://localhost:5050/slave%281%29/executor | |
$ path /slave(1)/executo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/url" | |
) | |
func main() { | |
uri := "http://localhost:5050/slave(1)/executor" | |
url, err := url.Parse(uri) | |
if err != nil { | |
panic("") | |
} | |
fmt.Println("url", url) | |
fmt.Println("path", url.Path) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment