Documentation
¶
Index ¶
- Constants
- func Bundle(patterns ...string) (string, error)
- func GetPackageIdentifier(spec *ast.ImportSpec) string
- func GetPackageNameFromPath(pkgPath string) string
- type Packages
- type PkgPath
- type PkgWriter
- func (p *PkgWriter) String() string
- func (p *PkgWriter) WriteImportDecl(imports []PkgPath, pkgStrFn func(PkgPath) string)
- func (p *PkgWriter) WritePackage(fset *token.FileSet, files []*ast.File, pkgPath string) error
- func (p *PkgWriter) WritePackageClause(pkgName string)
- func (p *PkgWriter) WriteSubPackage(fset *token.FileSet, file *ast.File) error
Constants ¶
View Source
const Delim = "__"
Variables ¶
This section is empty.
Functions ¶
func GetPackageIdentifier ¶
func GetPackageIdentifier(spec *ast.ImportSpec) string
GetPackageIdentifier は golang/go の慣習に則り ImportSpec から利用可能なパッケージ名を導出します。
Types ¶
type Packages ¶
type Packages struct {
Roots []*packages.Package
// All following fields are calculated
Unfold map[PkgPath]*packages.Package
ImportsUnfold []PkgPath // in topological order
ImportsRetain []PkgPath // in topological order
}
func NewPackage ¶
type PkgWriter ¶
type PkgWriter struct {
Writer *strings.Builder
Buf bytes.Buffer
// contains filtered or unexported fields
}
func NewPkgWriter ¶
func NewPkgWriter() *PkgWriter
func (*PkgWriter) WriteImportDecl ¶
func (*PkgWriter) WritePackage ¶
func (*PkgWriter) WritePackageClause ¶
Click to show internal directories.
Click to hide internal directories.