[#1431] node: Fix 'empty slice declaration using a literal'
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 35s
DCO action / DCO (pull_request) Successful in 1m32s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m53s
Vulncheck / Vulncheck (pull_request) Successful in 2m14s
Build / Build Components (pull_request) Successful in 2m27s
Tests and linters / gopls check (pull_request) Successful in 2m29s
Tests and linters / Staticcheck (pull_request) Successful in 2m58s
Tests and linters / Lint (pull_request) Successful in 3m42s
Tests and linters / Tests (pull_request) Successful in 4m14s
Tests and linters / Tests with -race (pull_request) Successful in 5m28s

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-10-14 18:16:59 +03:00
parent c9afdbe089
commit a305ba5202
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD
4 changed files with 9 additions and 9 deletions

View file

@ -95,7 +95,7 @@ func TestProcessorEmitsGasToNetmapIfNoParsedWallets(t *testing.T) {
t.Parallel()
var emission uint64 = 100_000
var index int = 5
var parsedWallets []util.Uint160 = []util.Uint160{}
var parsedWallets []util.Uint160
alphabetContracts := innerring.NewAlphabetContracts()
for i := range index + 1 {
@ -167,7 +167,7 @@ func TestProcessorDoesntEmitGasIfNoNetmapOrParsedWallets(t *testing.T) {
t.Parallel()
var emission uint64 = 100_000
var index int = 5
var parsedWallets []util.Uint160 = []util.Uint160{}
var parsedWallets []util.Uint160
alphabetContracts := innerring.NewAlphabetContracts()
for i := range index + 1 {
@ -176,7 +176,7 @@ func TestProcessorDoesntEmitGasIfNoNetmapOrParsedWallets(t *testing.T) {
morphClient := &testMorphClient{}
nodes := []netmap.NodeInfo{}
var nodes []netmap.NodeInfo
network := &netmap.NetMap{}
network.SetNodes(nodes)

View file

@ -368,7 +368,7 @@ func (s *Shard) Close() error {
if s.rb != nil {
s.rb.Stop(s.log)
}
components := []interface{ Close() error }{}
var components []interface{ Close() error }
if s.pilorama != nil {
components = append(components, s.pilorama)

View file

@ -25,7 +25,7 @@ var (
alphaKeys keys.PublicKeys
wrongAlphaKeys keys.PublicKeys
dummyAlphabetInvocationScript = []byte{} // expected to be empty if generated by Notary Actor, as requester can't fill it in
dummyAlphabetInvocationScript []byte
dummyAlphabetInvocationScriptOld = append([]byte{byte(opcode.PUSHDATA1), 64}, make([]byte, 64)...) // expected to be dummy if generated manually
wrongDummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64, 1}, make([]byte, 63)...)

View file

@ -18,7 +18,7 @@ import (
)
func GeneratePayloadPool(count uint, size uint) [][]byte {
pool := [][]byte{}
var pool [][]byte
for i := uint(0); i < count; i++ {
payload := make([]byte, size)
_, _ = rand.Read(payload)
@ -29,7 +29,7 @@ func GeneratePayloadPool(count uint, size uint) [][]byte {
}
func GenerateAttributePool(count uint) []objectSDK.Attribute {
pool := []objectSDK.Attribute{}
var pool []objectSDK.Attribute
for i := uint(0); i < count; i++ {
for j := uint(0); j < count; j++ {
attr := *objectSDK.NewAttribute()
@ -42,7 +42,7 @@ func GenerateAttributePool(count uint) []objectSDK.Attribute {
}
func GenerateOwnerPool(count uint) []user.ID {
pool := []user.ID{}
var pool []user.ID
for i := uint(0); i < count; i++ {
pool = append(pool, usertest.ID())
}
@ -117,7 +117,7 @@ func WithPayloadFromPool(pool [][]byte) ObjectOption {
func WithAttributesFromPool(pool []objectSDK.Attribute, count uint) ObjectOption {
return func(obj *objectSDK.Object) {
attrs := []objectSDK.Attribute{}
var attrs []objectSDK.Attribute
for i := uint(0); i < count; i++ {
attrs = append(attrs, pool[rand.Intn(len(pool))])
}