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

Method prefix

protoc-gen-go/generator/generator.go:176–183  ·  view source on GitHub ↗

Everything but the last element of the full type name, CamelCased. The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .

()

Source from the content-addressed store, hash-verified

174// Everything but the last element of the full type name, CamelCased.
175// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .
176func (e *EnumDescriptor) prefix() string {
177 if e.parent == nil {
178 // If the enum is not part of a message, the prefix is just the type name.
179 return CamelCase(*e.Name) + "_"
180 }
181 typeName := e.TypeName()
182 return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_"
183}
184
185// The integer value of the named constant in this enumerated type.
186func (e *EnumDescriptor) integerValueAsString(name string) string {

Callers 3

getterDefaultMethod · 0.95
generateEnumMethod · 0.80

Calls 3

TypeNameMethod · 0.95
CamelCaseFunction · 0.85
CamelCaseSliceFunction · 0.85

Tested by

no test coverage detected