I would like to do something like this, but apparently it is not possible in this way, I think that there is something I miss.
type command struct {
help string
handler func (params ...interface{})
}
func showHelp( commands map[string]command ) {
fmt.Println( "Help:" )
for c, h := range commands {
fmt.Println( c,"->" ,h.help )
}
}
func main() {
// Map to store commands
commands := make( map[string]command )
// Adding help command
commands["help"] = command{ "show this information", showHelp }
}