diff --git a/api/client/client.go b/api/client/client.go index 921c50478..6ffbf3437 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -9,4 +9,4 @@ func NewRPC(addr string) api.API { var res api.Struct rpclib.NewClient(addr, "Filecoin", &res.Internal) return &res -} \ No newline at end of file +} diff --git a/api/struct.go b/api/struct.go index e2c91b49b..a14982d24 100644 --- a/api/struct.go +++ b/api/struct.go @@ -7,8 +7,8 @@ import ( ) type Struct struct { - Internal struct{ - ID func(context.Context) (peer.ID, error) + Internal struct { + ID func(context.Context) (peer.ID, error) Version func(context.Context) (Version, error) } } @@ -21,4 +21,4 @@ func (c *Struct) Version(ctx context.Context) (Version, error) { return c.Internal.Version(ctx) } -var _ API = &Struct{} \ No newline at end of file +var _ API = &Struct{} diff --git a/daemon/rpc.go b/daemon/rpc.go index bc383cdbe..78df124c2 100644 --- a/daemon/rpc.go +++ b/daemon/rpc.go @@ -7,7 +7,6 @@ import ( "github.com/filecoin-project/go-lotus/rpclib" ) - func serveRPC(api api.API) error { rpcServer := rpclib.NewServer() rpcServer.Register("Filecoin", api) diff --git a/node/builder.go b/node/builder.go index 3e07fa5dd..0ddf431b6 100644 --- a/node/builder.go +++ b/node/builder.go @@ -57,7 +57,7 @@ func New(ctx context.Context) (api.API, error) { libp2p.Routing, libp2p.NatPortMap, - libp2p.ConnectionManager(50, 200, 20 * time.Second), + libp2p.ConnectionManager(50, 200, 20*time.Second), ), fx.Invoke( diff --git a/node/modules/core.go b/node/modules/core.go index e1df17d71..5bc21fcf5 100644 --- a/node/modules/core.go +++ b/node/modules/core.go @@ -8,6 +8,6 @@ import ( // RecordValidator provides namesys compatible routing record validator func RecordValidator(ps peerstore.Peerstore) record.Validator { return record.NamespacedValidator{ - "pk": record.PublicKeyValidator{}, + "pk": record.PublicKeyValidator{}, } } diff --git a/node/modules/helpers/helpers.go b/node/modules/helpers/helpers.go index 745bfcf46..4c3a04881 100644 --- a/node/modules/helpers/helpers.go +++ b/node/modules/helpers/helpers.go @@ -22,4 +22,3 @@ func LifecycleCtx(mctx MetricsCtx, lc fx.Lifecycle) context.Context { }) return ctx } - diff --git a/node/modules/libp2p/pnet.go b/node/modules/libp2p/pnet.go index a3345bbdd..805ed71bb 100644 --- a/node/modules/libp2p/pnet.go +++ b/node/modules/libp2p/pnet.go @@ -60,4 +60,4 @@ func PNetChecker(repo repo.Repo, ph host.Host, lc fx.Lifecycle) error { }) return nil } -*/ \ No newline at end of file +*/ diff --git a/node/modules/testing.go b/node/modules/testing.go index a8b4b3a1e..1634d67dd 100644 --- a/node/modules/testing.go +++ b/node/modules/testing.go @@ -19,4 +19,4 @@ func RandomPeerID() (peer.ID, error) { return "", err } return peer.ID(hash), nil -} \ No newline at end of file +} diff --git a/rpclib/rpcClient.go b/rpclib/rpcClient.go index 5607863b0..a8dc9b41e 100644 --- a/rpclib/rpcClient.go +++ b/rpclib/rpcClient.go @@ -12,7 +12,7 @@ import ( ) var ( - errorType = reflect.TypeOf(new(error)).Elem() + errorType = reflect.TypeOf(new(error)).Elem() contextType = reflect.TypeOf(new(context.Context)).Elem() ) @@ -80,7 +80,7 @@ func NewClient(addr string, namespace string, handler interface{}) { return out } - processError := func(err error) []reflect.Value{ + processError := func(err error) []reflect.Value { out := make([]reflect.Value, nout) if valOut != -1 { @@ -101,7 +101,7 @@ func NewClient(addr string, namespace string, handler interface{}) { fn := reflect.MakeFunc(ftyp, func(args []reflect.Value) (results []reflect.Value) { id := atomic.AddInt64(&idCtr, 1) - params := make([]param, len(args) - hasCtx) + params := make([]param, len(args)-hasCtx) for i, arg := range args[hasCtx:] { params[i] = param{ v: arg, diff --git a/rpclib/rpcServer.go b/rpclib/rpcServer.go index b0e039bfd..262f961df 100644 --- a/rpclib/rpcServer.go +++ b/rpclib/rpcServer.go @@ -151,7 +151,7 @@ func (s *RPCServer) Register(namespace string, r interface{}) { valOut, errOut, _ := processFuncOut(funcType) - fmt.Println(namespace+"."+method.Name) + fmt.Println(namespace + "." + method.Name) s.methods[namespace+"."+method.Name] = rpcHandler{ paramReceivers: recvs, diff --git a/rpclib/rpc_test.go b/rpclib/rpc_test.go index 7eb82b7c6..02efaf63c 100644 --- a/rpclib/rpc_test.go +++ b/rpclib/rpc_test.go @@ -167,7 +167,7 @@ func TestRPC(t *testing.T) { type CtxHandler struct { cancelled bool - i int + i int } func (h *CtxHandler) Test(ctx context.Context) { @@ -200,7 +200,7 @@ func TestCtx(t *testing.T) { } NewClient(testServ.URL, "CtxHandler", &client) - ctx, cancel := context.WithTimeout(context.Background(), 20 * time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond) defer cancel() client.Test(ctx) @@ -219,4 +219,4 @@ func TestCtx(t *testing.T) { if serverHandler.cancelled || serverHandler.i != 2 { t.Error("wrong serverHandler state") } -} \ No newline at end of file +}