Source

euler / go / src / euler / euler.go

Full commit
package main

import (
	"flag"
	"fmt"
)

type Solution struct {
	name string
	fn   func()
}

var solutions = []Solution{}

func register(name string, fn func()) {
	solutions = append(solutions, Solution{name, fn})
}


func main() {
	list := flag.Bool("list", false, "list solutions")
	flag.Parse()

	if *list {
		for _, sol := range solutions {
			fmt.Println(sol.name)
		}
	}

}