diff --git a/common/log/v3/log_test.go b/common/log/v3/log_test.go index afe745f79b1..99fc0243881 100644 --- a/common/log/v3/log_test.go +++ b/common/log/v3/log_test.go @@ -581,17 +581,18 @@ func TestCallerStackHandler(t *testing.T) { t.Fatalf("Wrong context value type, got %T expected string", r.Ctx[1]) } - exp := "[" + var exp strings.Builder + exp.WriteString("[") for i, line := range lines { if i > 0 { - exp += " " + exp.WriteString(" ") } - exp += fmt.Sprint(file, ":", line) + exp.WriteString(fmt.Sprint(file, ":", line)) } - exp += "]" + exp.WriteString("]") - if s != exp { - t.Fatalf("Wrong context value, got %s expected string matching %s", s, exp) + if s != exp.String() { + t.Fatalf("Wrong context value, got %s expected string matching %s", s, exp.String()) } } diff --git a/execution/protocol/rules/aura/aura.go b/execution/protocol/rules/aura/aura.go index cdf19e637ba..c1ce8ba2e90 100644 --- a/execution/protocol/rules/aura/aura.go +++ b/execution/protocol/rules/aura/aura.go @@ -193,7 +193,7 @@ func (e *EpochManager) zoomToAfter(chain rules.ChainHeaderReader, er *NonTransac e.finalityChecker = NewRollingFinality(epochSet) if proof.SignalNumber >= DEBUG_LOG_FROM { fmt.Printf("new rolling finality: %d\n", proof.SignalNumber) - for i := 0; i < len(epochSet); i++ { + for i := range epochSet { fmt.Printf("\t%x\n", epochSet[i]) } } diff --git a/node/app/event/eventbus_test.go b/node/app/event/eventbus_test.go index ea94953c4ce..08b68e5464a 100644 --- a/node/app/event/eventbus_test.go +++ b/node/app/event/eventbus_test.go @@ -173,9 +173,7 @@ func TestSubcribeOnceAsync(t *testing.T) { t.Fail() } - var cb func(a int, out *[]int) - - if bus.HasCallback(reflect.TypeOf(cb)) { + if bus.HasCallback(reflect.TypeFor[func(a int, out *[]int)]()) { t.Fail() } }