core: Implement FastAbs to avoid repeated os.Getwd calls (#6687)

* core: Implement FastAbs to avoid repeated os.Getwd calls

* Lint

* Rename files
This commit is contained in:
Francis Lavoie
2024-11-13 03:55:51 -05:00
committed by GitHub
parent 238f1108e6
commit 315715e90f
10 changed files with 90 additions and 16 deletions

View File

@ -20,7 +20,6 @@ import (
"io"
"math"
"os"
"path/filepath"
"strconv"
"github.com/dustin/go-humanize"
@ -133,7 +132,7 @@ func (fw *FileWriter) Provision(ctx caddy.Context) error {
}
func (fw FileWriter) String() string {
fpath, err := filepath.Abs(fw.Filename)
fpath, err := caddy.FastAbs(fw.Filename)
if err == nil {
return fpath
}