title: Additional arguments to http function Golang
body: <p>I am trying to pass string to handler in given example.</p>
  
  <pre><code>package main
  import (
  "fmt"
  "net/http"
  )
  
  func handler(w http.ResponseWriter, r *http.Request) {
       fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
  }
  
  func main() {
       http.HandleFunc("/", handler)
       http.ListenAndServe(":8080", nil)
  }
  </code></pre>
  
  <p>Here is what i tried but it throws an error as it expects regular number of arguments:</p>
  
  <pre><code>package main
  import (
  "fmt"
  "net/http"
  )
  
  func handler(w http.ResponseWriter, r *http.Request, s *string) {
       fmt.Fprintf(w, "Hi there, I love %s!", *s)
  }
  
  func main() {
       files := "bar"
       http.HandleFunc("/", handler(&amp;files))
       http.ListenAndServe(":8080", nil)
  }
  </code></pre>