func productsHandler(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {
	type Prod struct {
		Pline    string   
		Bline    string   
		Category string   
		Price    float32  
	}
	listFunction := func() []Prod {
		prods := []Prod{{}}
		err := Products3.Find(bson.M{
			"$and": []bson.M{
				{"sales.BR01": bson.M{"$gt": 30000}},
				{"sales.BR01": bson.M{"$lt": 60000}},
			},
		}).All(&prods)
		if err != nil {
			return nil
		}
		return prods
	}
	itemTemplate := `{{ define "body" }}
{{- range listFunction }}
{{ .Pline}} => {{ .Bline}} ==> {{ .Category}} ==> {{ .Price}}<br />
{{- end}}
{{ end }}`
	t := template.New("template.html")
	t = t.Funcs(template.FuncMap{"listFunction": listFunction})
	t, err := t.ParseFiles("template.html")
	t = template.Must(t, err)
	t = t.New("body")
	t, err = t.Parse(itemTemplate)
	t = template.Must(t, err)
	t.ExecuteTemplate(w, "template.html", "Products")
}
Anything below here requires database connection.  See db.go for connection details
productHandler is executing html template
package main
import (
	"fmt"
	"github.com/julienschmidt/httprouter"
	"gopkg.in/mgo.v2/bson"
	"html/template"
	"net/http"
)
var itemTemplate = `
        {{ define "body" }}
           {{- range listFunction }}
			{{ .Message}}<br />
			{{- end}}
        {{ end }}
     	`
func main() {
	defer s.Close()
	fmt.Println("HTTP port :80")
	r := httprouter.New()
	r.GET("/", indexHandler)
	r.GET("/view/", viewHandler)
	r.GET("/list/", listHandler)
	r.GET("/products/", productsHandler)
	r.GET("/aggregate/", aggregateHandler)
	r.GET("/aggregate/:br/", aggregateHandler)
	r.POST("/aggregate/:br/", aggregateHandler)
	r.NotFound = http.FileServer(http.Dir("public"))
	http.ListenAndServe(":80", r)
}
func viewHandler(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {
	type Output struct {
		Message string
	}
	listFunction := func() (r []Output) {
		r = append(r, Output{Message: fmt.Sprint("one")})
		r = append(r, Output{Message: fmt.Sprint("two")})
		r = append(r, Output{Message: fmt.Sprint("three")})
		r = append(r, Output{Message: fmt.Sprint("four")})
		return
	}
	functionMap := template.FuncMap{
		"listFunction": listFunction,
	}
	itemTemplate := `
        {{ define "body" }}
           {{- range listFunction }}
			{{ .Message}}<br />
			{{- end}}
        {{ end }}
     	`
	t := template.Must(template.New("template.html").Funcs(functionMap).ParseFiles("template.html"))
	t = template.Must(t.New("body").Parse(itemTemplate))
	t.ExecuteTemplate(w, "template.html", "View")
}
func indexHandler(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {
	type Output struct {
		Message string
	}
	listFunction := func() (r []Output) {
		r = append(r, Output{Message: fmt.Sprint("one -")})
		r = append(r, Output{Message: fmt.Sprint("two-")})
		r = append(r, Output{Message: fmt.Sprint("three-")})
		r = append(r, Output{Message: fmt.Sprint("four-")})
		return
	}
	functionMap := template.FuncMap{
		"listFunction": listFunction,
	}
	t := template.Must(template.New("template.html").Funcs(functionMap).ParseFiles("template.html"))
	t = template.Must(t.New("body").Parse(itemTemplate))
	t.ExecuteTemplate(w, "template.html", "Index")
}
func listHandler(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {
	type branch struct {
		Message string
		Note    string
	}
	listFunction := func() []branch {
		r := []branch{
			{Message: "column[2]", Note: "This is the note!"},
			{Message: "column[3]", Note: "This is the note!"},
			{Message: "column[1]", Note: "This is the note!"},
			{Message: "column[4]", Note: "This is the note!"},
			{Message: "column[5]", Note: "This is the note!"},
			{Message: "column[6]", Note: "This is the note!"},
			{Message: "column[8]", Note: "This is the note!"},
			{Message: "column[9]", Note: "This is the note!"},
			{Message: "column[7]", Note: "This is the note!"},
		}
		return r
	}
	functionMap := template.FuncMap{
		"listFunction": listFunction,
	}
	itemTemplate := `
{{- define "body" }}
	{{- range listFunction }}
	{{ .Message}} => {{ .Note}}<br />
	{{- end}}
 {{ end }}`
	t := template.Must(template.New("template.html").Funcs(functionMap).ParseFiles("template.html"))
	t = template.Must(t.New("body").Parse(itemTemplate))
	t.ExecuteTemplate(w, "template.html", "List")
}