mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Go: Handle filepath.Rel failure
This commit is contained in:
@@ -495,8 +495,15 @@ func extract(workspace project.GoWorkspace) {
|
||||
extractorArgs = append(extractorArgs, workspace.ModMode.ArgsForGoVersion(toolchain.GetEnvGoSemVer())...)
|
||||
}
|
||||
for _, module := range workspace.Modules {
|
||||
relModPath, _ := filepath.Rel(workspace.BaseDir, filepath.Dir(module.Path))
|
||||
extractorArgs = append(extractorArgs, relModPath)
|
||||
relModPath, relErr := filepath.Rel(workspace.BaseDir, filepath.Dir(module.Path))
|
||||
|
||||
if relErr != nil {
|
||||
log.Printf(
|
||||
"Unable to make module path %s relative to workspace base dir %s: %s\n",
|
||||
filepath.Dir(module.Path), workspace.BaseDir, relErr.Error())
|
||||
} else {
|
||||
extractorArgs = append(extractorArgs, relModPath)
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Running extractor command '%s %v' from directory '%s'.\n", extractor, extractorArgs, workspace.BaseDir)
|
||||
|
||||
Reference in New Issue
Block a user