Function
goModulePackageDir
(importPath: string, mod: GoModule, projectRoot: string)
Source from the content-addressed store, hash-verified
| 75 | * directory followed by the rest of the import path. |
| 76 | */ |
| 77 | export function goModulePackageDir(importPath: string, mod: GoModule, projectRoot: string): string { |
| 78 | const modDir = path.relative(projectRoot, mod.rootDir).split(path.sep).join('/'); |
| 79 | const rest = importPath === mod.modulePath ? '' : importPath.slice(mod.modulePath.length + 1); |
| 80 | return path.posix.join(modDir, rest); |
| 81 | } |
Tested by
no test coverage detected