defaultGoPackage returns the package name to use, derived from the import path of the package we're building code for.
()
| 635 | // defaultGoPackage returns the package name to use, |
| 636 | // derived from the import path of the package we're building code for. |
| 637 | func (g *Generator) defaultGoPackage() GoPackageName { |
| 638 | p := g.PackageImportPath |
| 639 | if i := strings.LastIndex(p, "/"); i >= 0 { |
| 640 | p = p[i+1:] |
| 641 | } |
| 642 | return cleanPackageName(p) |
| 643 | } |
| 644 | |
| 645 | // SetPackageNames sets the package name for this run. |
| 646 | // The package name must agree across all files being generated. |
no test coverage detected