chore: make FastAbs comment more easy to understand (#6692)

This commit is contained in:
WeidiDeng
2024-11-15 11:49:42 +08:00
committed by GitHub
parent 37f0c4bfae
commit 6028ff27fa
2 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,8 @@ import (
// 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.
// It's overall the same as stdlib's implementation, the difference
// being cached working directory.
func FastAbs(path string) (string, error) {
if filepath.IsAbs(path) {
return filepath.Clean(path), nil