I'm developing a REST API with Go, but I don't know how can I do the path mappings and retrieve the path parameters from them.
I want something like this:
func main() {
http.HandleFunc("/provisions/:id", Provisions) //<-- How can I map "id" parameter in the path?
http.ListenAndServe(":8080", nil)
}
func Provisions(w http.ResponseWriter, r *http.Request) {
//I want to retrieve here "id" parameter from request
}
I would like to use just http
package instead of web frameworks, if it is possible.
Thanks.
/
after/provisions
– Mair