Skip to content

Commit

Permalink
style(testplans): fix staticcheck error
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Oct 7, 2021
1 parent 456f060 commit 6aab775
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testplans/graphsync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ func runProvider(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitC
panic(err)
}
bs, err = ReadWriteFilestore(n)
if err != nil {
panic(err)
}
bsvc := blockservice.New(bs, offline.Exchange(bs))
dags := merkledag.NewDAGService(bsvc)
fileDS = format.NewBufferedDAG(ctx, dags)
Expand Down Expand Up @@ -590,10 +593,10 @@ func runProvider(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitC
// set up http server to send file
http.HandleFunc(fmt.Sprintf("/%s", node.Cid()), func(w http.ResponseWriter, r *http.Request) {
fileReader, err := os.Open(f.Name())
defer fileReader.Close()
if err != nil {
panic(err)
}
defer fileReader.Close()
_, err = io.Copy(w, fileReader)
if err != nil {
panic(err)
Expand Down

0 comments on commit 6aab775

Please sign in to comment.