From bbb10d14b60289d43964f76d98ec287b985d4761 Mon Sep 17 00:00:00 2001 From: ChengenH Date: Sat, 20 Apr 2024 17:27:42 +0800 Subject: [PATCH] improve: use errors.New to replace fmt.Errorf with no parameters --- driver/state/l1_current.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index efea71690..425ec1556 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -2,7 +2,7 @@ package state import ( "context" - "fmt" + "errors" "math/big" "github.com/ethereum/go-ethereum/common" @@ -29,7 +29,7 @@ func (s *State) SetL1Current(h *types.Header) { // BlockProposed event with given blockID / blockHash. func (s *State) ResetL1Current(ctx context.Context, blockID *big.Int) error { if blockID == nil { - return fmt.Errorf("empty block ID") + return errors.New("empty block ID") } log.Info("Reset L1 current cursor", "blockID", blockID)