title: How to use regexp get url pattern in golang?
body: <p>How to use regular expression matching URL, which does decide to use the corresponding function processing</p>
  
  <pre><code>package main
  
  import(
    "fmt"
    "net/http"
  )
  
  func main() {
    http.HandleFunc("/pattern", resolve)
    http.ListenAndServe(":8080", nil)
  }
  
  func resolve(w http.ResponseWriter, r * http.Request) {
    fmt.Println(r.URL.Host)
  }
  </code></pre>