cmd: use errrors.New instead of empty fmt.Errorf (#27329)

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
Delweng
2023-05-24 12:21:29 +02:00
committed by GitHub
parent 9231770811
commit e9c3183c52
20 changed files with 50 additions and 38 deletions
+2 -2
View File
@@ -184,7 +184,7 @@ func ImportChain(chain *core.BlockChain, fn string) error {
for batch := 0; ; batch++ {
// Load a batch of RLP blocks.
if checkInterrupt() {
return fmt.Errorf("interrupted")
return errors.New("interrupted")
}
i := 0
for ; i < importBatchSize; i++ {
@@ -207,7 +207,7 @@ func ImportChain(chain *core.BlockChain, fn string) error {
}
// Import the batch.
if checkInterrupt() {
return fmt.Errorf("interrupted")
return errors.New("interrupted")
}
missing := missingBlocks(chain, blocks[:i])
if len(missing) == 0 {