Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPackages ¶
func LoadPackages(cfg LoadConfig) (types.PackageMap, error)
LoadPackages parses Golang packages using AST.
func PackageNameOfDir ¶
PackageNameOfDir get package import path via dir
func UpdatePackages ¶
func UpdatePackages(p types.PackageMap, cfg LoadConfig) error
UpdatePackages updates the packages in the given PackageMap. The function would get and parse only packages that doesn't currently exists in given map.
Types ¶
type LoadConfig ¶
type LoadConfig struct {
// Paths could be absolute or relative path to given directory.
Paths []string
// PkgNames should be full pkg name i.e.: 'golang.org/x/mod/modfile'
PkgNames []string
// BuildFlags are the flags used by the ast.
BuildFlags []string
// Verbose sets the loader in verbose mode.
Verbose bool
// WithComments
WithComments bool
}
LoadConfig contains configuration used while loading packages.
Click to show internal directories.
Click to hide internal directories.