From 07cdbb815c1c8007a6de3df1726021c8109ff8ad Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 12 May 2021 18:29:39 +0300 Subject: [PATCH] *: drop unnecessary fmt.Sprintf uses gosimple: S1039: unnecessary use of fmt.Sprintf --- pkg/io/size.go | 2 +- pkg/vm/cli/cli_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/io/size.go b/pkg/io/size.go index 3075a77db..9ee40eeba 100644 --- a/pkg/io/size.go +++ b/pkg/io/size.go @@ -59,7 +59,7 @@ func GetVarSize(value interface{}) int { case reflect.Ptr: vser, ok := v.Interface().(Serializable) if !ok { - panic(fmt.Sprintf("unable to calculate GetVarSize for a non-Serializable pointer")) + panic("unable to calculate GetVarSize for a non-Serializable pointer") } cw := counterWriter{} w := NewBinWriterFromIO(&cw) diff --git a/pkg/vm/cli/cli_test.go b/pkg/vm/cli/cli_test.go index 477e996ec..7eb4a2abd 100644 --- a/pkg/vm/cli/cli_test.go +++ b/pkg/vm/cli/cli_test.go @@ -324,7 +324,7 @@ func TestLoadAbort(t *testing.T) { "run", ) - e.checkNextLine(t, fmt.Sprintf("READY: loaded 2 instructions")) + e.checkNextLine(t, "READY: loaded 2 instructions") e.checkNextLine(t, "Error:.*at instruction 1.*ABORT") } @@ -349,7 +349,7 @@ func TestBreakpoint(t *testing.T) { e.checkNextLine(t, "no program loaded") e.checkNextLine(t, "no program loaded") e.checkNextLine(t, "no program loaded") - e.checkNextLine(t, fmt.Sprintf("READY: loaded 5 instructions")) + e.checkNextLine(t, "READY: loaded 5 instructions") e.checkError(t, ErrMissingParameter) e.checkError(t, ErrInvalidParameter) e.checkNextLine(t, "breakpoint added at instruction 2") @@ -415,19 +415,19 @@ func TestStepIntoOverOut(t *testing.T) { "loadhex "+script, "step", "stepinto", "stepout", "run") - e.checkNextLine(t, fmt.Sprintf("READY: loaded \\d+ instructions")) + e.checkNextLine(t, "READY: loaded 8 instructions") e.checkNextLine(t, "at breakpoint 1.*CALL") e.checkNextLine(t, "instruction pointer at.*NOP") e.checkStack(t, 5) - e.checkNextLine(t, fmt.Sprintf("READY: loaded \\d+ instructions")) + e.checkNextLine(t, "READY: loaded 8 instructions") e.checkNextLine(t, "at breakpoint.*CALL") e.checkNextLine(t, "instruction pointer at.*PUSH3") e.checkNextLine(t, "at breakpoint.*ADD") e.checkStack(t, 2, 3) e.checkStack(t, 5) - e.checkNextLine(t, fmt.Sprintf("READY: loaded \\d+ instructions")) + e.checkNextLine(t, "READY: loaded 8 instructions") e.checkNextLine(t, "at breakpoint 1.*CALL") e.checkNextLine(t, "instruction pointer at.*PUSH3") e.checkNextLine(t, "instruction pointer at.*NOP")