MCPcopy Index your code
hub / github.com/php/frankenphp / FastAbs

Function FastAbs

internal/fastabs/filepath_unix.go:31–41  ·  view source on GitHub ↗

FastAbs is an optimized version of filepath.Abs for Unix systems, since we don't expect the working directory to ever change once Caddy is running. Avoid the os.Getwd syscall overhead.

(path string)

Source from the content-addressed store, hash-verified

29// since we don't expect the working directory to ever change once
30// Caddy is running. Avoid the os.Getwd syscall overhead.
31func FastAbs(path string) (string, error) {
32 if filepath.IsAbs(path) {
33 return filepath.Clean(path), nil
34 }
35
36 if wderr != nil {
37 return "", wderr
38 }
39
40 return filepath.Join(wd, path), nil
41}

Callers 10

FuzzRequestFunction · 0.92
WithRequestDocumentRootFunction · 0.92
newWorkerFunction · 0.92
parseMethod · 0.92
TestWorkerMetricsFunction · 0.92
TestAutoWorkerConfigFunction · 0.92
ProvisionMethod · 0.92
matchesPathMethod · 0.92

Calls

no outgoing calls

Tested by 4

FuzzRequestFunction · 0.74
TestWorkerMetricsFunction · 0.74
TestAutoWorkerConfigFunction · 0.74