MCPcopy
hub / github.com/golang/protobuf / decl

Method decl

protoc-gen-go/generator/generator.go:1889–1895  ·  view source on GitHub ↗

decl prints the declaration of the field in the struct (if any).

(g *Generator, mc *msgCtx)

Source from the content-addressed store, hash-verified

1887
1888// decl prints the declaration of the field in the struct (if any).
1889func (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.

Callers

nothing calls this directly

Calls 2

AnnotateFunction · 0.85
PMethod · 0.45

Tested by

no test coverage detected