1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package goctl type cmdPing struct{} func (cmd *cmdPing) Name() string { return "ping" } func (cmd *cmdPing) Run(_ []string) string { return "pong" } func init() { builtinHandlers = append(builtinHandlers, &cmdPing{}) }