Skip to content

Commit fe85a5c

Browse files
committed
Correct compile fail, use .Lookup correctly.
1 parent 483889c commit fe85a5c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

en/07.4.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ func main() {
365365

366366
templates, err = template.ParseFiles(allFiles...) #parses all .tmpl files in the 'templates' folder
367367

368-
s1, _ := templates.LookUp("header.tmpl")
368+
s1 := templates.Lookup("header.tmpl")
369369
s1.ExecuteTemplate(os.Stdout, "header", nil)
370370
fmt.Println()
371-
s2, _ := templates.LookUp("content.tmpl")
371+
s2 := templates.Lookup("content.tmpl")
372372
s2.ExecuteTemplate(os.Stdout, "content", nil)
373373
fmt.Println()
374-
s3, _ := templates.LookUp("footer.tmpl")
374+
s3 := templates.Lookup("footer.tmpl")
375375
s3.ExecuteTemplate(os.Stdout, "footer", nil)
376376
fmt.Println()
377377
s3.Execute(os.Stdout, nil)

es/07.4.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,13 @@ Código:
364364
365365
templates, err = template.ParseFiles(allFiles...) #parses all .tmpl files in the 'templates' folder
366366
367-
s1, _ := templates.LookUp("header.tmpl")
367+
s1 := templates.Lookup("header.tmpl")
368368
s1.ExecuteTemplate(os.Stdout, "header", nil)
369369
fmt.Println()
370-
s2, _ := templates.LookUp("content.tmpl")
370+
s2 := templates.Lookup("content.tmpl")
371371
s2.ExecuteTemplate(os.Stdout, "content", nil)
372372
fmt.Println()
373-
s3, _ := templates.LookUp("footer.tmpl")
373+
s3 := templates.Lookup("footer.tmpl")
374374
s3.ExecuteTemplate(os.Stdout, "footer", nil)
375375
fmt.Println()
376376
s3.Execute(os.Stdout, nil)

0 commit comments

Comments
 (0)