MCPcopy
hub / github.com/spf13/viper / exists

Function exists

file.go:95–104  ·  view source on GitHub ↗

exists checks if file exists.

(fs afero.Fs, path string)

Source from the content-addressed store, hash-verified

93
94// exists checks if file exists.
95func exists(fs afero.Fs, path string) (bool, error) {
96 stat, err := fs.Stat(path)
97 if err == nil {
98 return !stat.IsDir(), nil
99 }
100 if os.IsNotExist(err) {
101 return false, nil
102 }
103 return false, err
104}

Callers 1

searchInPathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected