Merge pull request #1850 from filecoin-project/chore/lint

Cleanup many lint warnings
This commit is contained in:
Łukasz Magiera
2020-05-29 18:06:06 +02:00
committed by GitHub
67 changed files with 163 additions and 818 deletions
+2 -3
View File
@@ -432,7 +432,7 @@ func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath stri
return err
}
defer bufferedDS.Remove(ctx, c)
defer bufferedDS.Remove(ctx, c) //nolint:errcheck
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
// entire DAG selector
@@ -440,7 +440,6 @@ func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath stri
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
f, err := os.Create(outputPath)
defer f.Close()
if err != nil {
return err
}
@@ -450,7 +449,7 @@ func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath stri
return err
}
return nil
return f.Close()
}
func (a *API) clientImport(ref api.FileRef, bufferedDS *ipld.BufferedDAG) (cid.Cid, error) {
+1 -1
View File
@@ -425,7 +425,7 @@ func (a *ChainAPI) ChainExport(ctx context.Context, tsk types.TipSetKey) (<-chan
r, w := io.Pipe()
out := make(chan []byte)
go func() {
defer w.Close()
defer w.Close() //nolint:errcheck // it is a pipe
if err := a.Chain.Export(ctx, ts, w); err != nil {
log.Errorf("chain export call failed: %s", err)
return
+1 -1
View File
@@ -17,7 +17,7 @@ import (
)
type remoteWorker struct {
api.WorkerApi
api.WorkerAPI
closer jsonrpc.ClientCloser
}