Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jan 10, 2021
1 parent f444e74 commit 524042f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions extern/sector-storage/ffiwrapper/sealer_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
break
}

done := make(chan struct{cid.Cid; error}, 1)
done := make(chan struct {
cid.Cid
error
}, 1)
pbuf := <-throttle
copy(pbuf, buf[:read])

Expand All @@ -152,7 +155,10 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
}()

c, err := sb.pieceCid(sector.ProofType, pbuf[:read])
done <- struct {cid.Cid; error }{c, err}
done <- struct {
cid.Cid
error
}{c, err}
}(read)

piecePromises = append(piecePromises, func() (abi.PieceInfo, error) {
Expand Down
8 changes: 4 additions & 4 deletions extern/sector-storage/ffiwrapper/sealer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
"io"
"io/ioutil"
"math/rand"
Expand Down Expand Up @@ -34,6 +33,7 @@ import (

"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
)

func init() {
Expand Down Expand Up @@ -654,7 +654,7 @@ func TestAddPiece512M(t *testing.T) {
r := rand.New(rand.NewSource(0x7e5))

c, err := sb.AddPiece(context.TODO(), storage.SectorRef{
ID: abi.SectorID{
ID: abi.SectorID{
Miner: miner,
Number: 0,
},
Expand Down Expand Up @@ -697,7 +697,7 @@ func BenchmarkAddPiece512M(b *testing.B) {

for i := 0; i < b.N; i++ {
c, err := sb.AddPiece(context.TODO(), storage.SectorRef{
ID: abi.SectorID{
ID: abi.SectorID{
Miner: miner,
Number: abi.SectorNumber(i),
},
Expand All @@ -708,4 +708,4 @@ func BenchmarkAddPiece512M(b *testing.B) {
}
fmt.Println(c)
}
}
}

0 comments on commit 524042f

Please sign in to comment.