1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package main // Union types func (u *Union) Define(c *Context) { c.Putln("// Union definition %s", u.SrcName()) } func (u *Union) Read(c *Context, prefix string) { c.Putln("// Union read %s", u.SrcName()) } func (u *Union) Write(c *Context, prefix string) { c.Putln("// Union write %s", u.SrcName()) }