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

Method AddImport

protoc-gen-go/generator/generator.go:530–533  ·  view source on GitHub ↗

AddImport adds a package to the generated file's import section. It returns the name used for the package.

(importPath GoImportPath)

Source from the content-addressed store, hash-verified

528// AddImport adds a package to the generated file's import section.
529// It returns the name used for the package.
530func (g *Generator) AddImport(importPath GoImportPath) GoPackageName {
531 g.addedImports[importPath] = true
532 return g.GoPackageName(importPath)
533}
534
535var globalPackageNames = map[GoPackageName]bool{
536 "fmt": true,

Callers 3

RecordTypeUseMethod · 0.95
GenerateMethod · 0.80

Calls 1

GoPackageNameMethod · 0.95

Tested by

no test coverage detected