bfs commit (exprimental)

This commit is contained in:
刘祥超
2024-04-26 18:44:29 +08:00
parent ef057b106e
commit f262e76f96
10 changed files with 250 additions and 89 deletions

View File

@@ -2,7 +2,10 @@
package bfs
import "errors"
import (
"errors"
"os"
)
var ErrClosed = errors.New("the file closed")
var ErrInvalidHash = errors.New("invalid hash")
@@ -11,3 +14,7 @@ var ErrFileIsWriting = errors.New("the file is writing")
func IsWritingErr(err error) bool {
return err != nil && errors.Is(err, ErrFileIsWriting)
}
func IsNotExist(err error) bool {
return err != nil && os.IsNotExist(err)
}