fix lint errors.

This commit is contained in:
Raúl Kripalani 2020-11-03 21:23:41 +00:00
parent 809111336a
commit 5487356370

View File

@ -18,6 +18,7 @@ import (
"github.com/cockroachdb/pebble" "github.com/cockroachdb/pebble"
"github.com/cockroachdb/pebble/bloom" "github.com/cockroachdb/pebble/bloom"
"github.com/ipfs/go-cid"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
@ -184,8 +185,8 @@ var importBenchCmd = &cli.Command{
case cctx.Bool("use-native-badger"): case cctx.Bool("use-native-badger"):
log.Info("using native badger") log.Info("using native badger")
opts, err := repo.BadgerBlockstoreOptions(repo.BlockstoreChain, tdir, false) var opts badgerbs.Options
if err != nil { if opts, err = repo.BadgerBlockstoreOptions(repo.BlockstoreChain, tdir, false); err != nil {
return err return err
} }
opts.SyncWrites = false opts.SyncWrites = false
@ -360,8 +361,8 @@ var importBenchCmd = &cli.Command{
var genesis *types.TipSet var genesis *types.TipSet
log.Infof("getting genesis block") log.Infof("getting genesis block")
if tsk := cctx.String("genesis-tipset"); tsk != "" { if tsk := cctx.String("genesis-tipset"); tsk != "" {
cids, err := lcli.ParseTipSetString(tsk) var cids []cid.Cid
if err != nil { if cids, err = lcli.ParseTipSetString(tsk); err != nil {
return xerrors.Errorf("failed to parse genesis tipset key: %w", err) return xerrors.Errorf("failed to parse genesis tipset key: %w", err)
} }
genesis, err = cs.LoadTipSet(types.NewTipSetKey(cids...)) genesis, err = cs.LoadTipSet(types.NewTipSetKey(cids...))
@ -382,8 +383,8 @@ var importBenchCmd = &cli.Command{
// Resolve the end tipset, falling back to head if not provided. // Resolve the end tipset, falling back to head if not provided.
end := head end := head
if tsk := cctx.String("end-tipset"); tsk != "" { if tsk := cctx.String("end-tipset"); tsk != "" {
cids, err := lcli.ParseTipSetString(tsk) var cids []cid.Cid
if err != nil { if cids, err = lcli.ParseTipSetString(tsk); err != nil {
return xerrors.Errorf("failed to end genesis tipset key: %w", err) return xerrors.Errorf("failed to end genesis tipset key: %w", err)
} }
end, err = cs.LoadTipSet(types.NewTipSetKey(cids...)) end, err = cs.LoadTipSet(types.NewTipSetKey(cids...))