Fixed bug in HTML template example.

This commit is contained in:
Alexander Nyquist 2014-07-03 09:11:44 +02:00
parent 31c3b913ac
commit fca05115ab

View File

@ -259,7 +259,11 @@ You can also use your own html template render
import "html/template" import "html/template"
func main() { func main() {
r := gin.Default() r := gin.Default()
html := template.ParseFiles("file1", "file2") html, err := template.ParseFiles("file1", "file2")
if err != nil {
fmt.Printf("Could not parse templates: %v\n", err)
return
}
r.HTMLTemplates = html r.HTMLTemplates = html
// Listen and server on 0.0.0.0:8080 // Listen and server on 0.0.0.0:8080