MCPcopy
hub / github.com/smallstep/cli / FileExists

Function FileExists

utils/read.go:29–35  ·  view source on GitHub ↗

FileExists is a wrapper on os.Stat that returns false if os.Stat returns an error, it returns true otherwise. This method does not care if os.Stat returns any other kind of errors.

(path string)

Source from the content-addressed store, hash-verified

27// error, it returns true otherwise. This method does not care if os.Stat
28// returns any other kind of errors.
29func FileExists(path string) bool {
30 if path == "" {
31 return false
32 }
33 _, err := os.Stat(path)
34 return err == nil
35}
36
37// ReadAll returns a slice of bytes with the content of the given reader.
38func ReadAll(r io.Reader) ([]byte, error) {

Callers 2

OfflineTokenFlowFunction · 0.92
TestFileExistsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFileExistsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…