feat: dir and file check
This commit is contained in:
16
internal/errs/object.go
Normal file
16
internal/errs/object.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user