isFile returns true if the path is a valid file.
(p string)
| 982 | |
| 983 | // isFile returns true if the path is a valid file. |
| 984 | func isFile(p string) bool { |
| 985 | // TODO(maruel): Is it faster to open the file or to stat it? Worth a perf |
| 986 | // test on Windows. |
| 987 | i, err := os.Stat(p) |
| 988 | return err == nil && !i.IsDir() |
| 989 | } |
| 990 | |
| 991 | // isRootedIn returns a root if the file split in parts exists under root. |
| 992 | // |
no outgoing calls
no test coverage detected
searching dependent graphs…