codestyle: declare empty slice

https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices
This commit is contained in:
Vsevolod Brekelov 2019-10-18 18:38:33 +03:00
parent 3560ada669
commit 1afdb895a1
2 changed files with 2 additions and 2 deletions

View file

@ -164,7 +164,7 @@ func TestBinBlockDecodeEncode(t *testing.T) {
"908a398dd65dfd2aad6c06090c5a71d5e5280746577a6ddd5a1f2c1453f71ead": false, "908a398dd65dfd2aad6c06090c5a71d5e5280746577a6ddd5a1f2c1453f71ead": false,
} }
hashes := []string{} var hashes []string
for _, tx := range b.Transactions { for _, tx := range b.Transactions {
switch tx.Type { switch tx.Type {

View file

@ -67,7 +67,7 @@ func makeStackItem(v interface{}) StackItem {
case StackItem: case StackItem:
return val return val
case []int: case []int:
a := []StackItem{} var a []StackItem
for _, i := range val { for _, i := range val {
a = append(a, makeStackItem(i)) a = append(a, makeStackItem(i))
} }