From 5462ecf6dab3a650f390355afb869160e72c2a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sun, 10 Jan 2021 22:54:21 +0100 Subject: [PATCH] gofmt --- extern/sector-storage/ffiwrapper/sealer_cgo.go | 10 ++++++++-- extern/sector-storage/ffiwrapper/sealer_test.go | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index 657fac08c..dca8b44b5 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -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]) @@ -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) { diff --git a/extern/sector-storage/ffiwrapper/sealer_test.go b/extern/sector-storage/ffiwrapper/sealer_test.go index 9e4aa0042..3b379af6f 100644 --- a/extern/sector-storage/ffiwrapper/sealer_test.go +++ b/extern/sector-storage/ffiwrapper/sealer_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader" "io" "io/ioutil" "math/rand" @@ -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() { @@ -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, }, @@ -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), }, @@ -708,4 +708,4 @@ func BenchmarkAddPiece512M(b *testing.B) { } fmt.Println(c) } -} \ No newline at end of file +}