Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PkgTypeStd - a std module PkgTypeStd = fastmod.PkgTypeGoroot // PkgTypeGopath - a module found at $GOPATH/src PkgTypeGopath = fastmod.PkgTypeGoroot // PkgTypeThis - this module itself PkgTypeThis = fastmod.PkgTypeMod // PkgTypeChild - child module of this module PkgTypeChild = fastmod.PkgTypeLocal // PkgTypeDepMod - a depended module found at $GOPATH/pkg/mod PkgTypeDepMod = fastmod.PkgTypeDepMod // PkgTypeLocalDep - a module that rewrites to local PkgTypeLocalDep = fastmod.PkgTypeLocalMod )
Variables ¶
View Source
var ( // BuildContext is the default build context. BuildContext = &build.Default )
Functions ¶
func LookupModFile ¶
LookupModFile finds go.mod file for a package directory.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a loaded module.
func LoadModule ¶
LoadModule loads a module from specified dir.
func (Module) Lookup ¶
func (p Module) Lookup(pkg string) (pi PackageInfo, err error)
Lookup returns package info, if found.
func (Module) ModFile ¶
ModFile returns `go.mod` file path of this module. eg. `$HOME/work/qiniu/qlang/go.mod`
func (Module) VersionPkgPath ¶
VersionPkgPath returns VersionPkgPath of this module. eg. `github.com/qiniu/qlang/v6@v1.0.0`
type PackageInfo ¶
PackageInfo represents a package info.
Click to show internal directories.
Click to hide internal directories.