Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.1.8 to 2.2.2. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.1.8...v2.2.2) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
18 lines
378 B
Go
18 lines
378 B
Go
package fsutil
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/gookit/goutil/internal/comfunc"
|
|
)
|
|
|
|
// Realpath returns the shortest path name equivalent to path by purely lexical processing.
|
|
func Realpath(pathStr string) string {
|
|
pathStr = comfunc.ExpandHome(pathStr)
|
|
|
|
if !IsAbsPath(pathStr) {
|
|
pathStr = JoinSubPaths(comfunc.Workdir(), pathStr)
|
|
}
|
|
return filepath.Clean(pathStr)
|
|
}
|