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

Method PrintComments

protoc-gen-go/generator/generator.go:1227–1236  ·  view source on GitHub ↗

PrintComments prints any comments from the source .proto file. The path is a comma-separated list of integers. It returns an indication of whether any comments were printed. See descriptor.proto for its format.

(path string)

Source from the content-addressed store, hash-verified

1225// It returns an indication of whether any comments were printed.
1226// See descriptor.proto for its format.
1227func (g *Generator) PrintComments(path string) bool {
1228 if !g.writeOutput {
1229 return false
1230 }
1231 if c, ok := g.makeComments(path); ok {
1232 g.P(c)
1233 return true
1234 }
1235 return false
1236}
1237
1238// makeComments generates the comment string for the field, no "\n" at the end
1239func (g *Generator) makeComments(path string) (string, bool) {

Callers 4

generateHeaderMethod · 0.95
generateEnumMethod · 0.95
generateMessageStructMethod · 0.95
generateServiceMethod · 0.80

Calls 2

makeCommentsMethod · 0.95
PMethod · 0.95

Tested by

no test coverage detected