From 34e50617402c913b721b5c3f114100730bedeb3d Mon Sep 17 00:00:00 2001 From: amorozov Date: Thu, 20 Jun 2024 20:06:29 +0300 Subject: [PATCH] feature: added file exists checker --- pkg/io/files/file_exists_checker.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pkg/io/files/file_exists_checker.go diff --git a/pkg/io/files/file_exists_checker.go b/pkg/io/files/file_exists_checker.go new file mode 100644 index 0000000..1629370 --- /dev/null +++ b/pkg/io/files/file_exists_checker.go @@ -0,0 +1,14 @@ +package files + +import ( + "errors" + "os" +) + +func IsFileExists(fileLocation string) bool { + if _, err := os.Stat(fileLocation); errors.Is(err, os.ErrNotExist) { + return false + } + + return true +}