Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoModDecl = errors.New("no module declaration in a .mod file") ErrNoModRoot = errors.New("go.mod file not found in current directory or any parent directory") ErrSaveDefault = errors.New("attemp to save default project") )
View Source
var Default = Module{ File: &gomodfile.File{ Module: &gomodfile.Module{}, Go: &gomodfile.Go{Version: defaultGoVer}, }, Opt: &modfile.File{ Gop: &modfile.Gop{Version: defaultGopVer}, }, }
Default represents the default gop.mod object.
Functions ¶
This section is empty.
Types ¶
type Module ¶
func Create ¶
Create creates a new module in `dir`. You should call `Save` manually to save this module.
func LoadFrom ¶ added in v0.11.9
LoadFrom loads a module from specified go.mod file and an optional gop.mod file.
func (Module) DepMods ¶
DepMods returns all depended modules. If a depended module path is replace to be a local path, it will be canonical to an absolute path.
func (Module) HasModfile ¶ added in v0.12.1
HasModfile returns if this module exists or not.
func (Module) HasProject ¶ added in v0.12.0
Click to show internal directories.
Click to hide internal directories.