feat: dir and file check

This commit is contained in:
Noah Hsu
2022-06-23 16:09:22 +08:00
parent d77dea733f
commit b971b13362
4 changed files with 26 additions and 11 deletions

16
internal/errs/object.go Normal file
View File

@ -0,0 +1,16 @@
package errs
import (
"errors"
pkgerr "github.com/pkg/errors"
)
var (
ObjectNotFound = errors.New("object not found")
NotFolder = errors.New("not a folder")
NotFile = errors.New("not a file")
)
func IsObjectNotFound(err error) bool {
return pkgerr.Cause(err) == ObjectNotFound
}