mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-09-17 09:29:21 +00:00
fix relPath when there's replacement
This commit is contained in:
parent
7f6bfc93a3
commit
d151d0b036
1 changed files with 3 additions and 3 deletions
|
@ -163,11 +163,11 @@ func fetchPackage(caches []map[string]*types.Package, importPath string, goPacka
|
||||||
rev = commitShaRev.FindAllStringSubmatch(rev, -1)[0][1]
|
rev = commitShaRev.FindAllStringSubmatch(rev, -1)[0][1]
|
||||||
}
|
}
|
||||||
|
|
||||||
goPackagePathPrefix, pathMajor, _ := module.SplitPathVersion(goPackagePath)
|
importPathPrefix, pathMajor, _ := module.SplitPathVersion(importPath)
|
||||||
|
|
||||||
// Relative path within the repo
|
// Relative path within the repo
|
||||||
relPath := strings.TrimPrefix(goPackagePathPrefix, repoRoot.Root+"/")
|
relPath := strings.TrimPrefix(importPathPrefix, repoRoot.Root+"/")
|
||||||
if relPath == goPackagePathPrefix {
|
if relPath == importPathPrefix {
|
||||||
relPath = ""
|
relPath = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue