mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-23 19:10:03 +08:00
chore: make FastAbs comment more easy to understand (#6692)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user