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

Method writeName

proto/text_encode.go:176–193  ·  view source on GitHub ↗
(fd protoreflect.FieldDescriptor)

Source from the content-addressed store, hash-verified

174}
175
176func (w *textWriter) writeName(fd protoreflect.FieldDescriptor) {
177 if !w.compact && w.complete {
178 w.writeIndent()
179 }
180 w.complete = false
181
182 if fd.Kind() != protoreflect.GroupKind {
183 w.buf = append(w.buf, fd.Name()...)
184 w.WriteByte(':')
185 } else {
186 // Use message type name for group field name.
187 w.buf = append(w.buf, fd.Message().Name()...)
188 }
189
190 if !w.compact {
191 w.WriteByte(' ')
192 }
193}
194
195func requiresQuotes(u string) bool {
196 // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.

Callers 1

writeMessageMethod · 0.95

Calls 3

writeIndentMethod · 0.95
WriteByteMethod · 0.95
NameMethod · 0.65

Tested by

no test coverage detected