Skip to content

Commit 49c1c5b

Browse files
committed
example: duslia pr
1 parent 33021ba commit 49c1c5b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lang/golang/parser/parser.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,12 @@ func getDeps(dir string, goWork bool) (a map[string]string, hasGoWork bool, cgoP
224224
cgoPkgs[module.Path] = true
225225
}
226226
if module.Replace != nil {
227-
deps[module.Path] = module.Replace.Path + "@" + module.Replace.Version
227+
if strings.HasPrefix(module.Replace.Path, "./") ||
228+
strings.HasPrefix(module.Replace.Path, "../") ||
229+
strings.HasPrefix(module.Replace.Path, "/") {
230+
// local replace
231+
deps[module.Path] = module.Path
232+
}
228233
} else {
229234
if module.Version != "" {
230235
deps[module.Path] = module.Path + "@" + module.Version

0 commit comments

Comments
 (0)