Skip to content

Commit

Permalink
update 03-template-advance fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bonfy committed Dec 3, 2018
1 parent 49694e1 commit 6cb9e63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 03-template-advance.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ templates.index.html

其实 Go 的模板应该没有 Flask jinja2 这样的功能强大,它只有 include,所以为了实现模板的继承,我们需要发挥下主观能动性

index.html
main.go

```go
package main
Expand Down Expand Up @@ -138,8 +138,8 @@ func main() {
u2 := User{Username: "rene"}

posts := []Post{
{User: u1, Body: "Beautiful day in Portland!"},
{User: u2, Body: "The Avengers movie was so cool!"},
Post{User: u1, Body: "Beautiful day in Portland!"},
Post{User: u2, Body: "The Avengers movie was so cool!"},
}

v := IndexViewModel{Title: "Homepage", User: u1, Posts: posts}
Expand Down

0 comments on commit 6cb9e63

Please sign in to comment.