mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 12:12:12 +08:00
Fixed bug in HTML template example.
This commit is contained in:
parent
31c3b913ac
commit
fca05115ab
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user