16 lines
326 B
Go
16 lines
326 B
Go
// Package util define universal utility functions
|
|
package util
|
|
|
|
import (
|
|
"errors"
|
|
"io/fs"
|
|
"os"
|
|
)
|
|
|
|
// FileExists return boolean value result specifying whether the file path exists
|
|
func FileExists(filePath string) bool {
|
|
_, err := os.Stat(filePath)
|
|
// return !os.IsNotExist(err)
|
|
return !errors.Is(err, fs.ErrNotExist)
|
|
}
|