 <p>You edited your original question to add this second question.</p> <blockquote> <p>Also, how could I change func QR to accept parameter values? What I'd like for it to do is accept a command-line flag in place of req *http.Request.</p> </blockquote> <p>If you read <a href="http://golang.org/doc/go_spec.html" rel="nofollow noreferrer">The Go Programming Language Specification</a>, <a href="http://golang.org/doc/go_spec.html#Types" rel="nofollow noreferrer">§Types</a>, including <a href="http://golang.org/doc/go_spec.html#Function_types" rel="nofollow noreferrer">§Function types</a>, you will see that Go has strong static typing, including function types. While this does not guarantee to catch all errors, it usually catches attempts to use invalid, non-matching function signatures.</p> <p>You don't tell us why you want to change the function signature for <code>QR</code>, in what appears to be an arbitrary and capricious fashion, so that it is no longer a valid <code>HandlerFunc</code> type, guaranteeing that the program will fail to even compile. We can only guess what you want to accomplish. Perhaps it's as simple as this: you want to modify the <code>http.Request</code>, based on a runtime parameter. Perhaps, something like this:</p> <pre><code>// Note: flag.Parse() in func main() {...} var qrFlag = flag.String("qr", "", "function QR parameter") func QR(c *http.Conn, req *http.Request) { if len(*qrFlag) &gt; 0 { // insert code here to use the qr parameter (qrFlag) // to modify the http.Request (req) } templ.Execute(req.FormValue("s"), c) } </code></pre> <p>Perhaps not! Who knows?</p>