From 3bb8dc0660e3a94a95ed5d44be82cf90cdbdbefe Mon Sep 17 00:00:00 2001 From: zhangdeman001 Date: Wed, 29 Jun 2022 15:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96RPC=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=8C=96=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rpc.go b/rpc.go index 3142174..be4d3c2 100644 --- a/rpc.go +++ b/rpc.go @@ -13,17 +13,23 @@ import ( "go.uber.org/zap" ) +var ( + // Request 请求实例 + Request *request +) + // InitRPC 初始化RPC服务 // // Author : go_developer@163.com<白茶清欢> // // Date : 15:23 2022/6/29 -func InitRPC(serviceTable map[string]Service, loggerInstance *zap.Logger) *request { - return &request{ +func InitRPC(serviceTable map[string]Service, loggerInstance *zap.Logger) error { + Request = &request{ logger: loggerInstance, serviceTable: serviceTable, lock: &sync.RWMutex{}, } + return nil } type request struct {