Skip to content

Commit

Permalink
Merge pull request #84 from xushiwei/q
Browse files Browse the repository at this point in the history
go doc
  • Loading branch information
xushiwei authored Jul 7, 2024
2 parents aaad4a2 + 3006dc5 commit c64de59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modload/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func LoadFromEx(gomod, gopmod string, readFile func(string) ([]byte, error)) (p
return Module{f, opt}, nil
}

// AddCompiler adds a custom Go compiler to this module.
func (p Module) AddCompiler(compiler, ver string) {
f := p.File
if f.Go == nil {
Expand All @@ -251,6 +252,7 @@ func addCompiler(opt *modfile.File, r *gomodfile.Go, compiler, ver string) {
}
}

// AddRequire adds a require package to this module.
func (p Module) AddRequire(path, vers string, hasProj bool) error {
f := p.File
f.AddRequire(path, vers)
Expand Down

0 comments on commit c64de59

Please sign in to comment.