Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lang/golang/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,17 @@ func getDeps(dir string, goWork bool) (a map[string]string, hasGoWork bool, cgoP
if len(mod.CgoFiles) > 0 {
cgoPkgs[module.Path] = true
}

if module.Replace != nil {
deps[module.Path] = module.Replace.Path + "@" + module.Replace.Version
Comment thread
wzekin marked this conversation as resolved.
if strings.HasPrefix(module.Replace.Path, "./") ||
strings.HasPrefix(module.Replace.Path, "../") ||
strings.HasPrefix(module.Replace.Path, "/") {
// local replace
deps[module.Path] = module.Path

} else {
deps[module.Path] = module.Replace.Path + "@" + module.Replace.Version
}
} else {
if module.Version != "" {
deps[module.Path] = module.Path + "@" + module.Version
Expand Down
Loading