Fixing formatting

This commit is contained in:
Pavel Shevaev 2022-11-15 17:53:34 +03:00
parent 5146eb7c3b
commit 564cd5cbbe
1 changed files with 32 additions and 34 deletions

View File

@ -49,7 +49,7 @@ type RPCServer struct {
gzipLenThreshold int gzipLenThreshold int
logger logr.Logger logger logr.Logger
newHandler func(ctx *RPCCtx) IRPCHandler newHandler func(ctx *RPCCtx) IRPCHandler
createRPC func(code uint32)(meta.IRPC, error) createRPC func(code uint32) (meta.IRPC, error)
} }
type IRPCHandler interface { type IRPCHandler interface {
@ -72,11 +72,11 @@ func NewRPCServer(logger logr.Logger,
versionHeader string, versionHeader string,
gzipLenThreshold int, gzipLenThreshold int,
newHandler func(ctx *RPCCtx) IRPCHandler, newHandler func(ctx *RPCCtx) IRPCHandler,
createRPC func(code uint32)(meta.IRPC, error)) *RPCServer { createRPC func(code uint32) (meta.IRPC, error)) *RPCServer {
return &RPCServer{ return &RPCServer{
isDev: isDev, isDev: isDev,
versionHeader: versionHeader, versionHeader: versionHeader,
gzipLenThreshold : gzipLenThreshold, gzipLenThreshold: gzipLenThreshold,
logger: logger.WithName("[rpc]"), logger: logger.WithName("[rpc]"),
newHandler: newHandler, newHandler: newHandler,
createRPC: createRPC} createRPC: createRPC}
@ -127,7 +127,6 @@ func GetIPStr(r *http.Request) string {
return ra return ra
} }
func (server *RPCServer) writeResponse(canGzip bool, w http.ResponseWriter, payload []byte) { func (server *RPCServer) writeResponse(canGzip bool, w http.ResponseWriter, payload []byte) {
if len(payload) == 0 { if len(payload) == 0 {
server.logger.Error(nil, "Nothing was written to response!") server.logger.Error(nil, "Nothing was written to response!")
@ -289,4 +288,3 @@ func parseVersionHeader(header string) (string, int) {
return cltVersion, cltPlatform return cltVersion, cltPlatform
} }