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

Function RegisterUniquePackageName

protoc-gen-go/generator/generator.go:543–550  ·  view source on GitHub ↗

Create and remember a guaranteed unique package name. Pkg is the candidate name. The FileDescriptor parameter is unused.

(pkg string, f *FileDescriptor)

Source from the content-addressed store, hash-verified

541// Create and remember a guaranteed unique package name. Pkg is the candidate name.
542// The FileDescriptor parameter is unused.
543func RegisterUniquePackageName(pkg string, f *FileDescriptor) string {
544 name := cleanPackageName(pkg)
545 for i, orig := 1, name; globalPackageNames[name]; i++ {
546 name = orig + GoPackageName(strconv.Itoa(i))
547 }
548 globalPackageNames[name] = true
549 return string(name)
550}
551
552var isGoKeyword = map[string]bool{
553 "break": true,

Callers

nothing calls this directly

Calls 2

cleanPackageNameFunction · 0.85
GoPackageNameTypeAlias · 0.85

Tested by

no test coverage detected