relPath returns a relative path from the base path to the target path.
(basePath, targetPath string)
| 106 | |
| 107 | // relPath returns a relative path from the base path to the target path. |
| 108 | func relPath(basePath, targetPath string) (string, error) { |
| 109 | rp, err := filepath.Rel(basePath, targetPath) |
| 110 | if err == nil && !isRelPathSpecifier(rp) { |
| 111 | rp = "./" + rp |
| 112 | } |
| 113 | return rp, err |
| 114 | } |
| 115 | |
| 116 | // findFiles returns a list of files in the given directory. |
| 117 | func findFiles(root string, dir string, filter func(filename string) bool) ([]string, error) { |
no test coverage detected