From 42bb91c2e6d26851146b4d93c3f4b3663e62ce1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 14 Aug 2020 23:40:41 +0200 Subject: [PATCH] gofmt --- api/client/client.go | 2 +- lib/rpcenc/reader.go | 1 + lib/rpcenc/reader_test.go | 6 +++--- storage/wdpost_run.go | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/api/client/client.go b/api/client/client.go index b62a9fe59..02fb7c775 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -75,7 +75,7 @@ func NewWorkerRPC(addr string, requestHeader http.Header) (api.WorkerAPI, jsonrp requestHeader, rpcenc.ReaderParamEncoder(u.String()), jsonrpc.WithNoReconnect(), - jsonrpc.WithWriteTimeout(30 * time.Second), + jsonrpc.WithWriteTimeout(30*time.Second), ) return &res, closer, err diff --git a/lib/rpcenc/reader.go b/lib/rpcenc/reader.go index 346c551a1..010884423 100644 --- a/lib/rpcenc/reader.go +++ b/lib/rpcenc/reader.go @@ -27,6 +27,7 @@ var log = logging.Logger("rpcenc") var Timeout = 30 * time.Second type StreamType string + const ( Null StreamType = "null" PushStream StreamType = "push" diff --git a/lib/rpcenc/reader_test.go b/lib/rpcenc/reader_test.go index 0748f51ef..ec4ead52d 100644 --- a/lib/rpcenc/reader_test.go +++ b/lib/rpcenc/reader_test.go @@ -48,7 +48,7 @@ func TestReaderProxy(t *testing.T) { testServ := httptest.NewServer(mux) defer testServ.Close() - re := ReaderParamEncoder("http://"+testServ.Listener.Addr().String()+"/rpc/streams/v0/push") + re := ReaderParamEncoder("http://" + testServ.Listener.Addr().String() + "/rpc/streams/v0/push") closer, err := jsonrpc.NewMergeClient("ws://"+testServ.Listener.Addr().String()+"/rpc/v0", "ReaderHandler", []interface{}{&client}, nil, re) require.NoError(t, err) @@ -61,7 +61,7 @@ func TestReaderProxy(t *testing.T) { func TestNullReaderProxy(t *testing.T) { var client struct { - ReadAll func(ctx context.Context, r io.Reader) ([]byte, error) + ReadAll func(ctx context.Context, r io.Reader) ([]byte, error) ReadNullLen func(ctx context.Context, r io.Reader) (int64, error) } @@ -78,7 +78,7 @@ func TestNullReaderProxy(t *testing.T) { testServ := httptest.NewServer(mux) defer testServ.Close() - re := ReaderParamEncoder("http://"+testServ.Listener.Addr().String()+"/rpc/streams/v0/push") + re := ReaderParamEncoder("http://" + testServ.Listener.Addr().String() + "/rpc/streams/v0/push") closer, err := jsonrpc.NewMergeClient("ws://"+testServ.Listener.Addr().String()+"/rpc/v0", "ReaderHandler", []interface{}{&client}, nil, re) require.NoError(t, err) diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index 13f5547eb..dff0fc9fe 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -323,9 +323,9 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di miner.DeadlineInfo } params := &miner.SubmitWindowedPoStParams{ - Deadline: di.Index, - Partitions: make([]miner.PoStPartition, 0, len(partitions)), - Proofs: nil, + Deadline: di.Index, + Partitions: make([]miner.PoStPartition, 0, len(partitions)), + Proofs: nil, } var sinfos []abi.SectorInfo