Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (32 sloc) 807 Bytes
// Package main shows an example of pug actions based on
package main
import ""
type Person struct {
Name string
Age int
Emails []string
Jobs []*Job
type Job struct {
Employer string
Role string
func main() {
app := iris.New()
tmpl := iris.Pug("./templates", ".pug")
app.Get("/", index)
// http://localhost:8080
func index(ctx iris.Context) {
job1 := Job{Employer: "Monash B", Role: "Honorary"}
job2 := Job{Employer: "Box Hill", Role: "Head of HE"}
person := Person{
Name: "jan",
Age: 50,
Emails: []string{"", ""},
Jobs: []*Job{&job1, &job2},
ctx.View("index.pug", person)
You can’t perform that action at this time.