Documentation
¶
Index ¶
- func QualifiedIdentifierInfo(se *ast.SelectorExpr, path string, prog *loader.Program) (packagePath, packageName, importAlias, codeAlias string)
- type ImportsHelper
- func (ih *ImportsHelper) ImportsFromFile() (map[string]string, error)
- func (ih *ImportsHelper) ImportsFromTree() (decl *ast.GenDecl, specs map[string]*ast.ImportSpec, imports map[string]string, ...)
- func (ih *ImportsHelper) Refresh(imports map[string]string) error
- func (ih *ImportsHelper) RefreshFromCode() error
- func (ih *ImportsHelper) RefreshFromFile() error
- func (ih *ImportsHelper) RegisterImport(path string) (name string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QualifiedIdentifierInfo ¶
func QualifiedIdentifierInfo(se *ast.SelectorExpr, path string, prog *loader.Program) (packagePath, packageName, importAlias, codeAlias string)
QualifiedIdentifierInfo gets info about a package from the SelectorExpr packagePath: the package path of the imported package packageName: the actual name of the imported package importAlias: the alias in the import statement (can be "") codeAlias: the alias used in the code (if importAlias == "", codeAlias == packageName)
Types ¶
type ImportsHelper ¶
type ImportsHelper struct {
// contains filtered or unexported fields
}
func NewImportsHelper ¶
func (*ImportsHelper) ImportsFromFile ¶
func (ih *ImportsHelper) ImportsFromFile() (map[string]string, error)
func (*ImportsHelper) ImportsFromTree ¶
func (ih *ImportsHelper) ImportsFromTree() (decl *ast.GenDecl, specs map[string]*ast.ImportSpec, imports map[string]string, err error)
func (*ImportsHelper) RefreshFromCode ¶
func (ih *ImportsHelper) RefreshFromCode() error
RefreshFromCode scans all the code for SelectorElements
func (*ImportsHelper) RefreshFromFile ¶
func (ih *ImportsHelper) RefreshFromFile() error
func (*ImportsHelper) RegisterImport ¶
func (ih *ImportsHelper) RegisterImport(path string) (name string, err error)
RegisterImport
Click to show internal directories.
Click to hide internal directories.