mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
96ffcaa134
* PluginManager: Require signing of external plugins Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
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
|
|
}
|