code: func GoTypeForEnum(typ cc.Type, name string, types ...map[string]bg.Template) string {
  	if typ == nil {
  		return "<nil>"
  	}
  	if typ.Kind() != cc.Enum {
  		panic(fmt.Sprintf("invalid type: %v", typ))
  	}
  	tag := typ.Tag()
  	if tag != 0 {
  		n := string(xc.Dict.S(tag))
  		for _, t := range types {
  			if s, ok := t[n]; ok {
  				var buf bytes.Buffer
  				err := s.Execute(&buf, name)
  				if err != nil {
  					panic(err)
  				}
  				return buf.String()
  			}
  		}
  	}
  	log.Printf("%s", typ.Declarator())
  	panic(fmt.Sprintf("unknown type: %+v", typ))
  }
docs: // GoTypeForEnum returns a string representation of the given enum type using a mapping
  // in types. GoTypeForEnum will panic if no type mapping is found after searching the
  // user-provided types mappings or the type is not an enum.