mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 12:09:08 +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]
|
||||
}
|
||||
|
||||
goPackagePathPrefix, pathMajor, _ := module.SplitPathVersion(goPackagePath)
|
||||
importPathPrefix, pathMajor, _ := module.SplitPathVersion(importPath)
|
||||
|
||||
// Relative path within the repo
|
||||
relPath := strings.TrimPrefix(goPackagePathPrefix, repoRoot.Root+"/")
|
||||
if relPath == goPackagePathPrefix {
|
||||
relPath := strings.TrimPrefix(importPathPrefix, repoRoot.Root+"/")
|
||||
if relPath == importPathPrefix {
|
||||
relPath = ""
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue