Skip to content

Commit d9e4bbf

Browse files
committed
Fix error rewrinting in 'cmd/wmd/internal/importer.go'.
1 parent 68f7ddc commit d9e4bbf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmd/wmd/internal/importer.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"time"
99

1010
"github.com/pkg/errors"
11+
"go.uber.org/zap"
12+
1113
"github.com/wavesplatform/gowaves/cmd/wmd/internal/data"
1214
"github.com/wavesplatform/gowaves/cmd/wmd/internal/state"
1315
"github.com/wavesplatform/gowaves/pkg/crypto"
1416
"github.com/wavesplatform/gowaves/pkg/proto"
15-
"go.uber.org/zap"
1617
)
1718

1819
type Importer struct {
@@ -39,9 +40,9 @@ func (im *Importer) Import(n string) error {
3940
return errors.Wrapf(err, "failed to open blockchain file '%s'", n)
4041
}
4142
defer func() {
42-
err = f.Close()
43-
if err != nil {
44-
zap.S().Errorf("Failed to close blockchain file: %s", err.Error())
43+
closeErr := f.Close()
44+
if closeErr != nil {
45+
zap.S().Errorf("Failed to close blockchain file: %s", closeErr.Error())
4546
}
4647
}()
4748

0 commit comments

Comments
 (0)