ResolveSymlinks ensures that if the path supplied is a symlink, it is resolved to the actual concrete path
(path string)
| 56 | // ResolveSymlinks ensures that if the path supplied is a symlink, it is |
| 57 | // resolved to the actual concrete path |
| 58 | func ResolveSymlinks(path string) string { |
| 59 | if len(path) == 0 { |
| 60 | return path |
| 61 | } |
| 62 | |
| 63 | if resolved, err := CanonicalizeSystemPath(path); err == nil { |
| 64 | return resolved |
| 65 | } |
| 66 | return path |
| 67 | } |
| 68 | |
| 69 | // RenameFileCopyPermissions moves srcfile to destfile, replacing destfile if |
| 70 | // necessary and also copying the permissions of destfile if it already exists |
no test coverage detected