MCPcopy Create free account
hub / github.com/nginx-proxy/docker-gen / PathExists

Function PathExists

internal/utils/utils.go:27–36  ·  view source on GitHub ↗

PathExists returns whether the given file or directory exists or not

(path string)

Source from the content-addressed store, hash-verified

25
26// PathExists returns whether the given file or directory exists or not
27func PathExists(path string) (bool, error) {
28 _, err := os.Stat(path)
29 if err == nil {
30 return true, nil
31 }
32 if errors.Is(err, fs.ErrNotExist) {
33 return false, nil
34 }
35 return false, err
36}

Callers 3

NewDockerClientFunction · 0.92
tlsEnabledFunction · 0.92
TestPathExistsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPathExistsFunction · 0.68