16 lines
247 B
Go
16 lines
247 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
|
||
|
}
|