```golang
import (
"github.com/arschles/go-bindata-html-template"
)
//...
func myHandler(res http.ResponseWriter, req *http.Request) {
tmpl, err := template.New("mytmpl", Asset).Parse("data/templates/my.tmpl")
if err != nil {
log.Fatalf("error parsing template: %s", err)
}
err := tmpl.Execute(res)
if err != nil {
log.Fatalf("error executing template: %s", err)
}
}
```
有疑问加站长微信联系(非本文作者)