From 1afdb895a1d6301fc7d4d86eecf18b8b611c2118 Mon Sep 17 00:00:00 2001 From: Vsevolod Brekelov Date: Fri, 18 Oct 2019 18:38:33 +0300 Subject: [PATCH] codestyle: declare empty slice https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices --- pkg/core/block_test.go | 2 +- pkg/vm/stack_item.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/core/block_test.go b/pkg/core/block_test.go index 1c2f5e790..b56a7ec36 100644 --- a/pkg/core/block_test.go +++ b/pkg/core/block_test.go @@ -164,7 +164,7 @@ func TestBinBlockDecodeEncode(t *testing.T) { "908a398dd65dfd2aad6c06090c5a71d5e5280746577a6ddd5a1f2c1453f71ead": false, } - hashes := []string{} + var hashes []string for _, tx := range b.Transactions { switch tx.Type { diff --git a/pkg/vm/stack_item.go b/pkg/vm/stack_item.go index 468453d7b..925676a67 100644 --- a/pkg/vm/stack_item.go +++ b/pkg/vm/stack_item.go @@ -67,7 +67,7 @@ func makeStackItem(v interface{}) StackItem { case StackItem: return val case []int: - a := []StackItem{} + var a []StackItem for _, i := range val { a = append(a, makeStackItem(i)) }