mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Go: Add methods to GoModule for the tidy and vendor commands
These ensure that the module path is used automatically
This commit is contained in:
@@ -168,7 +168,7 @@ func tryUpdateGoModAndGoSum(workspace project.GoWorkspace) {
|
||||
beforeGoSumFileInfo, beforeGoSumErr := os.Stat(goSumPath)
|
||||
|
||||
// run `go mod tidy -e`
|
||||
cmd := toolchain.TidyModule(goModDir)
|
||||
cmd := goMod.Tidy()
|
||||
res := util.RunCmd(cmd)
|
||||
|
||||
if !res {
|
||||
@@ -428,7 +428,7 @@ func installDependencies(workspace project.GoWorkspace) {
|
||||
path := filepath.Dir(module.Path)
|
||||
|
||||
if util.DirExists(filepath.Join(path, "vendor")) {
|
||||
vendor := toolchain.VendorModule(path)
|
||||
vendor := module.Vendor()
|
||||
log.Printf("Synchronizing vendor file using `go mod vendor` in %s.\n", path)
|
||||
util.RunCmd(vendor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user