Fix imports and range reference warnings

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-08 17:14:36 +02:00
parent 4f277c8d15
commit 4df601ea6a
11 changed files with 36 additions and 17 deletions

View File

@ -26,6 +26,9 @@ issues:
- path: node/modules/lp2p - path: node/modules/lp2p
linters: linters:
- golint - golint
- path: ".*_test.go"
linters:
- gosec
linters-settings: linters-settings:
goconst: goconst:

View File

@ -3,6 +3,7 @@ package chain
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/go-lotus/chain/address" "github.com/filecoin-project/go-lotus/chain/address"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"

View File

@ -54,6 +54,7 @@ func TestVectorsIDAddress(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing actorID address: %s", tc.expected), func(t *testing.T) { t.Run(fmt.Sprintf("testing actorID address: %s", tc.expected), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
@ -149,6 +150,7 @@ func TestVectorSecp256k1Address(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing secp256k1 address: %s", tc.expected), func(t *testing.T) { t.Run(fmt.Sprintf("testing secp256k1 address: %s", tc.expected), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
@ -221,6 +223,7 @@ func TestVectorActorAddress(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing Actor address: %s", tc.expected), func(t *testing.T) { t.Run(fmt.Sprintf("testing Actor address: %s", tc.expected), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
@ -302,6 +305,7 @@ func TestVectorBLSAddress(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing bls address: %s", tc.expected), func(t *testing.T) { t.Run(fmt.Sprintf("testing bls address: %s", tc.expected), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
@ -348,6 +352,7 @@ func TestInvalidStringAddresses(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing string address: %s", tc.expetErr), func(t *testing.T) { t.Run(fmt.Sprintf("testing string address: %s", tc.expetErr), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
@ -382,6 +387,7 @@ func TestInvalidByteAddresses(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("testing byte address: %s", tc.expetErr), func(t *testing.T) { t.Run(fmt.Sprintf("testing byte address: %s", tc.expetErr), func(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)

View File

@ -4,12 +4,14 @@ import (
"bufio" "bufio"
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/go-lotus/lib/cborrpc" "math/rand"
"sync"
exchange "github.com/ipfs/go-ipfs-exchange-interface" exchange "github.com/ipfs/go-ipfs-exchange-interface"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-core/protocol"
"math/rand"
"sync" "github.com/filecoin-project/go-lotus/lib/cborrpc"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor" cbor "github.com/ipfs/go-ipld-cbor"

View File

@ -5,12 +5,13 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/filecoin-project/go-lotus/chain/address"
bls "github.com/filecoin-project/go-lotus/lib/bls-signatures"
cid "github.com/ipfs/go-cid" cid "github.com/ipfs/go-cid"
hamt "github.com/ipfs/go-hamt-ipld" hamt "github.com/ipfs/go-hamt-ipld"
"github.com/pkg/errors" "github.com/pkg/errors"
sharray "github.com/whyrusleeping/sharray" sharray "github.com/whyrusleeping/sharray"
"github.com/filecoin-project/go-lotus/chain/address"
bls "github.com/filecoin-project/go-lotus/lib/bls-signatures"
) )
type Miner struct { type Miner struct {

View File

@ -4,9 +4,10 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/go-lotus/chain"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/filecoin-project/go-lotus/chain"
) )
var log = logging.Logger("sub") var log = logging.Logger("sub")

View File

@ -1,10 +1,10 @@
package daemon package daemon
import ( import (
"github.com/filecoin-project/go-lotus/lib/jsonrpc"
"net/http" "net/http"
"github.com/filecoin-project/go-lotus/api" "github.com/filecoin-project/go-lotus/api"
"github.com/filecoin-project/go-lotus/lib/jsonrpc"
) )
func serveRPC(api api.API) error { func serveRPC(api api.API) error {

View File

@ -3,15 +3,16 @@ package hello
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/lib/cborrpc"
"github.com/libp2p/go-libp2p-core/host"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor" cbor "github.com/ipfs/go-ipld-cbor"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p-core/host"
inet "github.com/libp2p/go-libp2p-core/network" inet "github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/lib/cborrpc"
) )
const ProtocolID = "/fil/hello/1.0.0" const ProtocolID = "/fil/hello/1.0.0"

View File

@ -2,8 +2,7 @@ package modules
import ( import (
"context" "context"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/node/modules/helpers"
"github.com/ipfs/go-bitswap" "github.com/ipfs/go-bitswap"
"github.com/ipfs/go-bitswap/network" "github.com/ipfs/go-bitswap/network"
blockstore "github.com/ipfs/go-ipfs-blockstore" blockstore "github.com/ipfs/go-ipfs-blockstore"
@ -14,6 +13,9 @@ import (
"github.com/libp2p/go-libp2p-core/routing" "github.com/libp2p/go-libp2p-core/routing"
record "github.com/libp2p/go-libp2p-record" record "github.com/libp2p/go-libp2p-record"
"go.uber.org/fx" "go.uber.org/fx"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/node/modules/helpers"
) )
var log = logging.Logger("modules") var log = logging.Logger("modules")

View File

@ -1,14 +1,15 @@
package modules package modules
import ( import (
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/sub"
"github.com/filecoin-project/go-lotus/node/hello"
"github.com/filecoin-project/go-lotus/node/modules/helpers"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
inet "github.com/libp2p/go-libp2p-core/network" inet "github.com/libp2p/go-libp2p-core/network"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx" "go.uber.org/fx"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/sub"
"github.com/filecoin-project/go-lotus/node/hello"
"github.com/filecoin-project/go-lotus/node/modules/helpers"
) )
func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) { func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) {

View File

@ -1,9 +1,10 @@
package testing package testing
import ( import (
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/filecoin-project/go-lotus/chain" "github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/node/modules" "github.com/filecoin-project/go-lotus/node/modules"
blockstore "github.com/ipfs/go-ipfs-blockstore"
) )
func MakeGenesis(bs blockstore.Blockstore, w *chain.Wallet) (modules.Genesis, error) { func MakeGenesis(bs blockstore.Blockstore, w *chain.Wallet) (modules.Genesis, error) {