rows, err := conn.Queryx("SELECT id, name FROM users")
if err != nil {
log.Fatalln(err)
}
defer rows.Close()
users := []User{}
for rows.Next() {
if rows.StructScan(&user) != nil {
log.Fatalln(err)
}
users = append(users, user)
}
ctx.HTML(http.StatusOK, "users/index.tmpl", gin.H{"values": users})