IsFilePathExists returns true if path exists and path is file
(path string)
| 122 | |
| 123 | // IsFilePathExists returns true if path exists and path is file |
| 124 | func IsFilePathExists(path string) bool { |
| 125 | info, err := os.Stat(path) |
| 126 | if err != nil { |
| 127 | // path not exists |
| 128 | return false |
| 129 | } |
| 130 | |
| 131 | // path exists |
| 132 | if info.IsDir() { |
| 133 | // path is dir, not file |
| 134 | return false |
| 135 | } |
| 136 | return true |
| 137 | } |
| 138 | |
| 139 | // IsFolderPathExists returns true if path exists and path is folder |
| 140 | func IsFolderPathExists(path string) bool { |
no test coverage detected