Fix more lint warnings

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-05-28 01:15:19 +02:00
parent 7232e5481c
commit b372881e91
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
7 changed files with 15 additions and 17 deletions

View File

@ -207,7 +207,7 @@ var msigInspectCmd = &cli.Command{
fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%d\t%x\n", txid, state(tx), tx.To, types.FIL(tx.Value), tx.Method, tx.Params) fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%d\t%x\n", txid, state(tx), tx.To, types.FIL(tx.Value), tx.Method, tx.Params)
} }
if err := w.Flush(); err != nil { if err := w.Flush(); err != nil {
return xerrors.Errorf("flushing ouput: %+v", err) return xerrors.Errorf("flushing output: %+v", err)
} }
} }

View File

@ -157,7 +157,7 @@ var sealBenchCmd = &cli.Command{
return err return err
} }
err = os.MkdirAll(sdir, 0775) err = os.MkdirAll(sdir, 0775) //nolint:gosec
if err != nil { if err != nil {
return xerrors.Errorf("creating sectorbuilder dir: %w", err) return xerrors.Errorf("creating sectorbuilder dir: %w", err)
} }

View File

@ -48,7 +48,7 @@ func PreSeal(maddr address.Address, pt abi.RegisteredProof, offset abi.SectorNum
SealProofType: spt, SealProofType: spt,
} }
if err := os.MkdirAll(sbroot, 0775); err != nil { //golint:gosec if err := os.MkdirAll(sbroot, 0775); err != nil { //nolint:gosec
return nil, nil, err return nil, nil, err
} }

View File

@ -389,7 +389,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
if err != nil { if err != nil {
return err return err
} }
defer lr.Close() //notlint:errcheck defer lr.Close() //nolint:errcheck
log.Info("Initializing libp2p identity") log.Info("Initializing libp2p identity")

View File

@ -6,17 +6,16 @@ import (
logging "github.com/ipfs/go-log/v2" logging "github.com/ipfs/go-log/v2"
) )
//nolint:gosec
func SetupLogLevels() { func SetupLogLevels() {
if _, set := os.LookupEnv("GOLOG_LOG_LEVEL"); !set { if _, set := os.LookupEnv("GOLOG_LOG_LEVEL"); !set {
logging.SetLogLevel("*", "INFO") _ = logging.SetLogLevel("*", "INFO")
logging.SetLogLevel("dht", "ERROR") _ = logging.SetLogLevel("dht", "ERROR")
logging.SetLogLevel("swarm2", "WARN") _ = logging.SetLogLevel("swarm2", "WARN")
logging.SetLogLevel("bitswap", "WARN") _ = logging.SetLogLevel("bitswap", "WARN")
//logging.SetLogLevel("pubsub", "WARN") //_ = logging.SetLogLevel("pubsub", "WARN")
logging.SetLogLevel("connmgr", "WARN") _ = logging.SetLogLevel("connmgr", "WARN")
logging.SetLogLevel("advmgr", "DEBUG") _ = logging.SetLogLevel("advmgr", "DEBUG")
logging.SetLogLevel("stores", "DEBUG") _ = logging.SetLogLevel("stores", "DEBUG")
logging.SetLogLevel("nat", "INFO") _ = logging.SetLogLevel("nat", "INFO")
} }
} }

View File

@ -435,7 +435,6 @@ func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath stri
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node() ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
f, err := os.Create(outputPath) f, err := os.Create(outputPath)
defer f.Close() //nolint:errcheck
if err != nil { if err != nil {
return err return err
} }
@ -445,7 +444,7 @@ func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath stri
return err return err
} }
return nil return f.Close()
} }
func (a *API) clientImport(ref api.FileRef, bufferedDS *ipld.BufferedDAG) (cid.Cid, error) { func (a *API) clientImport(ref api.FileRef, bufferedDS *ipld.BufferedDAG) (cid.Cid, error) {

View File

@ -18,7 +18,7 @@ func AddrFilters(filters []string) func() (opts Libp2pOpts, err error) {
if err != nil { if err != nil {
return opts, fmt.Errorf("incorrectly formatted address filter in config: %s", s) return opts, fmt.Errorf("incorrectly formatted address filter in config: %s", s)
} }
opts.Opts = append(opts.Opts, libp2p.FilterAddresses(f)) //golint:staticcheck opts.Opts = append(opts.Opts, libp2p.FilterAddresses(f)) //nolint:staticcheck
} }
return opts, nil return opts, nil
} }