From 2398b5179d70df78c7e666a71b97099cdeb1b7a6 Mon Sep 17 00:00:00 2001 From: Alexander Nyquist Date: Thu, 3 Jul 2014 16:21:55 +0200 Subject: [PATCH] Using template.Must instead of catching errors manually --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 27c5cf9f..041b49c5 100644 --- a/README.md +++ b/README.md @@ -259,11 +259,7 @@ You can also use your own html template render import "html/template" func main() { r := gin.Default() - html, err := template.ParseFiles("file1", "file2") - if err != nil { - fmt.Printf("Could not parse templates: %v\n", err) - return - } + html := template.Must(template.ParseFiles("file1", "file2")) r.HTMLTemplates = html // Listen and server on 0.0.0.0:8080