This commit is contained in:
cdle
2023-06-14 19:55:19 +08:00
parent b125da91fd
commit 562d7f5d63
2 changed files with 25 additions and 22 deletions
+2 -2
View File
@@ -376,12 +376,12 @@ func (bucket *Bucket) First(i interface{}) error {
b := tx.Bucket([]byte(bucket.name))
if b == nil {
err = errors.New("bucket not find")
return nil
return err
}
data := b.Get([]byte(fmt.Sprint(v)))
if len(data) == 0 {
err = errors.New("record not find")
return nil
return err
}
return json.Unmarshal(data, i)
})