JoinDir joins dir and path if path is relative. If path is empty or absolute, it is returned unchanged.
(dir, path string)
| 83 | // JoinDir joins dir and path if path is relative. |
| 84 | // If path is empty or absolute, it is returned unchanged. |
| 85 | func JoinDir(dir, path string) string { |
| 86 | if path == "" || filepath.IsAbs(path) { |
| 87 | return path |
| 88 | } |
| 89 | return filepath.Join(dir, path) |
| 90 | } |
no outgoing calls
no test coverage detected