pattern matcher for go
import "github.com/fredim/go-pat/m"
matchCases := m.BuildCases(pat1, func1, pat2, func2, ...)
"string() as s", func(s string) string { return "got a string!" },
"int(123)" matches an integer 123
"MyStruct{Member:value}"
"MyStruct{Member:val}", func(val MemberType) string { ... }
"MyStruct{Member:InnerStruct{}}"
"MyStruct{Member:InnerStruct{}} as ms", func(ms MyStruct) string { .. }
var matchFn func() string
matchCases.Match(obj, &matchFn)
return matchFn()