by shirogane86x · 10mo ago · 0 comments
func rootInfo(root, p string) (has bool, isDir bool, err error) {
p = path.Clean(p)
info, err := os.Stat(root + "/" + p)
if info != nil {
has, isDir = true, info.IsDir()
return
}
if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) {
err = nil
}
return
}