mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
19 lines
272 B
Go
19 lines
272 B
Go
|
package fs
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
// Exists determines whether a file/directory exists or not.
|
||
|
func Exists(fpath string) (bool, error) {
|
||
|
_, err := os.Stat(fpath)
|
||
|
if err != nil {
|
||
|
if !os.IsNotExist(err) {
|
||
|
return false, err
|
||
|
}
|
||
|
return false, nil
|
||
|
}
|
||
|
|
||
|
return true, nil
|
||
|
}
|