Skip to content

Instantly share code, notes, and snippets.

@yifan-gu
Created July 18, 2014 22:09
Show Gist options
  • Save yifan-gu/3764a6d3d1a0e68d18c2 to your computer and use it in GitHub Desktop.
Save yifan-gu/3764a6d3d1a0e68d18c2 to your computer and use it in GitHub Desktop.
url escape
$ go run testurlparse.go
$ url http://localhost:5050/slave%281%29/executor
$ path /slave(1)/executo
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