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

Method generateEnumRegistration

protoc-gen-go/generator/generator.go:2617–2628  ·  view source on GitHub ↗
(enum *EnumDescriptor)

Source from the content-addressed store, hash-verified

2615}
2616
2617func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {
2618 // // We always print the full (proto-world) package name here.
2619 pkg := enum.File().GetPackage()
2620 if pkg != "" {
2621 pkg += "."
2622 }
2623 // The full type name
2624 typeName := enum.TypeName()
2625 // The full type name, CamelCased.
2626 ccTypeName := CamelCaseSlice(typeName)
2627 g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName)
2628}
2629
2630// And now lots of helper functions.
2631

Callers 1

generateEnumMethod · 0.95

Calls 4

addInitfMethod · 0.95
CamelCaseSliceFunction · 0.85
FileMethod · 0.65
TypeNameMethod · 0.65

Tested by

no test coverage detected