refactor: remove directive errors comparison (#20344)

This commit is contained in:
Kien Trinh
2024-05-10 19:09:21 +00:00
committed by GitHub
parent 946c62410f
commit 0c91044220
13 changed files with 27 additions and 18 deletions
+2 -2
View File
@@ -874,7 +874,7 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {
nodeCount := 0
for {
node, err := exporter.Next()
if err == iavltree.ErrorExportDone {
if errors.Is(err, iavltree.ErrorExportDone) {
rs.logger.Debug("snapshot Done", "store", store.name, "nodeCount", nodeCount)
break
} else if err != nil {
@@ -920,7 +920,7 @@ loop:
for {
snapshotItem = snapshottypes.SnapshotItem{}
err := protoReader.ReadMsg(&snapshotItem)
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
} else if err != nil {
return snapshottypes.SnapshotItem{}, errorsmod.Wrap(err, "invalid protobuf message")