Fix lint gosec and ifshort issues

This commit is contained in:
Lawrence, Rendall
2022-04-12 18:51:03 +03:00
parent 554ae6fcd6
commit 64eaf9d733
10 changed files with 25 additions and 22 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"math/rand"
"testing"
_ "github.com/sot-tech/mochi/pkg/rand_seed"
_ "github.com/sot-tech/mochi/pkg/randseed"
"github.com/stretchr/testify/require"
)
@@ -54,7 +54,7 @@ func build(confBytes []byte, st storage.Storage) (container.Container, error) {
for _, hashString := range c.HashList {
ih, err := bittorrent.NewInfoHash(hashString)
if err != nil {
return nil, fmt.Errorf("whitelist : %s : %v", hashString, err)
return nil, fmt.Errorf("whitelist : %s : %w", hashString, err)
}
init = append(init, storage.Pair{Left: ih.RawString(), Right: DUMMY})
if len(ih) == bittorrent.InfoHashV2Len {