mirror of
https://github.com/caddyserver/caddy.git
synced 2025-11-03 00:09:39 +08:00
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:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user