1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/util/file/file.go
2022-09-30 16:27:07 +02:00

16 lines
248 B
Go

package file
import "os"
// Exists returns true if the path is existing.
func Exists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return true, err
}