Documentation ¶
Overview ¶
Package parser contains utilities for parsing relevant library files, respecting build constraints and tracking go.mod files, imports and package names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDir ¶
func ParseDir(fset *token.FileSet, dirPath string, modulePathHint string) (pkgs map[string]*Package, err error)
ParseDir recursively parses a single package directory from source code.
modulePathHint is the full package path (required if no go.mod is present). pkgs maps package path to Package.
func ParseDirModules ¶
func ParseDirModules(fset *token.FileSet, dirPath, modulePathHint string) (goVer string, modules map[string]string, require []module.Version, err error)
ParseDirModules fetches package info from source code. It recursively parses a single package directory.
modulePathHint is the full package path (required if no go.mod is present). goVer is the semantic version of the module. modules maps package path to package name. require lists all dependencies of the parsed package.