Combines and resolves paths. If a path is absolute, it replaces any previous path. Any `.` and `..` path components are resolved. Trailing directory separators are preserved. ```go resolvePath("/path", "to", "file.ext") == "path/to/file.ext" resolvePath("/path", "to", "file.ext/") == "path/to/file.
(path string, paths ...string)
| 320 | // resolvePath("/path", "dir", "..", "to", "file.ext") == "path/to/file.ext" |
| 321 | // ``` |
| 322 | func ResolvePath(path string, paths ...string) string { |
| 323 | var combinedPath string |
| 324 | if len(paths) > 0 { |
| 325 | combinedPath = CombinePaths(path, paths...) |
| 326 | } else { |
| 327 | combinedPath = NormalizeSlashes(path) |
| 328 | } |
| 329 | return NormalizePath(combinedPath) |
| 330 | } |
| 331 | |
| 332 | func ResolveTripleslashReference(moduleName string, containingFile string) string { |
| 333 | basePath := GetDirectoryPath(containingFile) |