feat: Add OsFs-compliant support for Readlink, Symlink and Lstat

This commit is contained in:
Felicitas Pojtinger
2022-01-16 18:03:43 +01:00
parent f2c6c65a53
commit 2a28fa3b5f
6 changed files with 229 additions and 153 deletions

View File

@@ -1,5 +1,11 @@
package pathext
func IsRoot(path string) bool {
import "strings"
func IsRoot(path string, trim bool) bool {
if trim && len(strings.TrimSpace(path)) == 0 {
return true
}
return path == "" || path == "." || path == "/" || path == "./"
}