handlers/articles/articles.go
func List(c *gin.Context) {
	db := c.MustGet("db").(*mgo.Database)
	articles := []models.Article{}
	err := db.C(models.CollectionArticle).Find(nil).Sort("-updated_on").All(&articles)
	if err != nil {
		c.Error(err)
	}
	c.HTML(http.StatusOK, "articles/list", gin.H{
		"title":    "Articles",
		"articles": articles,
	})
}
func List(c *gin.Context) {
	db := c.MustGet("db").(*mgo.Database)
	articles := []models.Article{}
	err := db.C(models.CollectionArticle).Find(nil).Sort("-updated_on").All(&articles)
	if err != nil {
		c.Error(err)
	}
	c.HTML(http.StatusOK, "articles/list", gin.H{
		"title":    "Articles",
		"articles": articles,
	})
}
func List ( c * gin . Context ) { db := c . MustGet ( " " ) . ( * mgo . Database ) articles := [ ] models . Article { } err := db . C ( models . CollectionArticle ) . Find ( nil ) . Sort ( " " ) . All ( & articles ) if err != nil { c . Error ( err ) } c . HTML ( http . StatusOK , " " , gin . H { " " : " " , " " : articles , } ) }
// List all articles
List all articles