You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
395 B
Go
19 lines
395 B
Go
1 year ago
|
//go:build windows
|
||
|
|
||
|
package nfs
|
||
|
|
||
|
import (
|
||
|
"git.noahlan.cn/noahlan/ntool/internal/common"
|
||
|
"path/filepath"
|
||
|
)
|
||
|
|
||
|
// Realpath returns the shortest path name equivalent to path by purely lexical processing.
|
||
|
func Realpath(pathStr string) string {
|
||
|
pathStr = common.ExpandHome(pathStr)
|
||
|
|
||
|
if !IsAbsPath(pathStr) {
|
||
|
pathStr = JoinSubPaths(common.Workdir(), pathStr)
|
||
|
}
|
||
|
return filepath.Clean(pathStr)
|
||
|
}
|