decl prints the declaration of the field in the struct (if any).
(g *Generator, mc *msgCtx)
| 1887 | |
| 1888 | // decl prints the declaration of the field in the struct (if any). |
| 1889 | func (f *oneofField) decl(g *Generator, mc *msgCtx) { |
| 1890 | comment := f.comment |
| 1891 | for _, sf := range f.subFields { |
| 1892 | comment += "//\t*" + sf.oneofTypeName + "\n" |
| 1893 | } |
| 1894 | g.P(comment, Annotate(mc.message.file, f.fullPath, f.goName), " ", f.goType, " `", f.tags, "`") |
| 1895 | } |
| 1896 | |
| 1897 | // getter for a oneof field will print additional discriminators and interfaces for the oneof, |
| 1898 | // also it prints all the getters for the sub fields. |