diff options
| author | Jeff Carr <[email protected]> | 2024-01-30 16:48:57 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-30 16:48:57 -0600 |
| commit | 1fda646fef4737e9b027462589d89f97045a00c0 (patch) | |
| tree | 4b52587f45f7f3d0ba5cd22f2d469562f6812e5c /unix.go | |
| parent | 78049e664d7955df52d64aca3adc74b7539d1fa6 (diff) | |
add a stat(file) shortcut
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -212,6 +212,15 @@ func IsDirectory(path string) bool { return info.IsDir() } +// returns true if the file exists +func Exists(file string) bool { + _, err := os.Stat(file) + if err != nil { + return false + } + return true +} + func VerifyLocalGoRepo(gorepo string) bool { // Get current user usr, err := user.Current() |
