address review comments; lint.

This commit is contained in:
Raúl Kripalani 2020-09-27 21:06:07 +01:00
parent f5f23f7291
commit fe869c9c22
7 changed files with 14 additions and 10 deletions

View File

@ -304,7 +304,7 @@ func runExtract(_ *cli.Context) error {
if err != nil { if err != nil {
return err return err
} }
defer output.Close() defer output.Close() //nolint:errcheck
defer log.Printf("wrote test vector to file: %s", file) defer log.Printf("wrote test vector to file: %s", file)
} }

View File

@ -23,7 +23,9 @@ var apiEndpoint string
var apiFlag = cli.StringFlag{ var apiFlag = cli.StringFlag{
Name: "api", Name: "api",
Usage: "json-rpc api endpoint, formatted as token:multiaddr", Usage: "json-rpc api endpoint, formatted as [token]:multiaddr;" +
"tvx uses unpriviliged operations, so the token may be omitted," +
"but permissions may change in the future",
EnvVars: []string{"FULLNODE_API_INFO"}, EnvVars: []string{"FULLNODE_API_INFO"},
DefaultText: "", DefaultText: "",
Destination: &apiEndpoint, Destination: &apiEndpoint,

View File

@ -9,7 +9,7 @@ import (
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/ipfs/go-ipld-format" format "github.com/ipfs/go-ipld-format"
"github.com/ipld/go-car" "github.com/ipld/go-car"
cbg "github.com/whyrusleeping/cbor-gen" cbg "github.com/whyrusleeping/cbor-gen"

View File

@ -6,6 +6,7 @@ import (
"sync" "sync"
"github.com/fatih/color" "github.com/fatih/color"
dssync "github.com/ipfs/go-datastore/sync"
"github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/lib/blockstore" "github.com/filecoin-project/lotus/lib/blockstore"
@ -40,7 +41,8 @@ type Stores struct {
// proxies Get requests for unknown CIDs to a Filecoin node, via the // proxies Get requests for unknown CIDs to a Filecoin node, via the
// ChainReadObj RPC. // ChainReadObj RPC.
func NewProxyingStores(ctx context.Context, api api.FullNode) *Stores { func NewProxyingStores(ctx context.Context, api api.FullNode) *Stores {
ds := ds.NewMapDatastore() ds := dssync.MutexWrap(ds.NewMapDatastore())
ds = dssync.MutexWrap(ds)
bs := &proxyingBlockstore{ bs := &proxyingBlockstore{
ctx: ctx, ctx: ctx,

View File

@ -33,17 +33,17 @@ type LogReporter struct {
var _ Reporter = (*LogReporter)(nil) var _ Reporter = (*LogReporter)(nil)
func (_ *LogReporter) Helper() {} func (*LogReporter) Helper() {}
func (_ *LogReporter) Log(args ...interface{}) { func (*LogReporter) Log(args ...interface{}) {
log.Println(args...) log.Println(args...)
} }
func (_ *LogReporter) Logf(format string, args ...interface{}) { func (*LogReporter) Logf(format string, args ...interface{}) {
log.Printf(format, args...) log.Printf(format, args...)
} }
func (_ *LogReporter) FailNow() { func (*LogReporter) FailNow() {
os.Exit(1) os.Exit(1)
} }

View File

@ -164,7 +164,7 @@ func dumpThreeWayStateDiff(r Reporter, vector *schema.TestVector, bs blockstore.
if err != nil { if err != nil {
r.Fatalf("failed to write temporary state CAR: %s", err) r.Fatalf("failed to write temporary state CAR: %s", err)
} }
defer os.RemoveAll(tmpCar) defer os.RemoveAll(tmpCar) //nolint:errcheck
color.NoColor = false // enable colouring. color.NoColor = false // enable colouring.