Golang Common Error: missing ‘,’ before newline in composite literal


This is my previous (error) code:

r.GET("/", func(c *gin.Context) {
          c.HTML(http.StatusOK, "main.html", pongo2.Context{
              "title":    "Hello world !",
              "greating": "Hi, Hello world my mate!"
          })
      })  

And here is the changes:

r.GET("/", func(c *gin.Context) {
          c.HTML(http.StatusOK, "main.html", pongo2.Context{
              "title":    "Hello world !",
              "greating": "Hi, Hello world my mate!",
          })
      })

can you find the different ? no ? here is the mitsake:

“greating”: “Hi, Hello world my mate!”,

Yeah the error is because of missing a comma LOL

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s