From 95350594636f430fa1d9945feca5813a238a8ba9 Mon Sep 17 00:00:00 2001 From: guzeng Date: Tue, 17 Aug 2021 11:09:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conn.go b/conn.go index 108750d..e9fb5c5 100644 --- a/conn.go +++ b/conn.go @@ -6,9 +6,13 @@ import ( func rpc_server_conn(url ...string) (*ProductServiceClient, error) { - var rpc_url string = "127.0.0.1:" + conf.PRODUCT_RPC_PORT + var rpc_url string if len(url) > 0 && url[0] != "" { rpc_url = url[0] + } else if conf.PRODUCT_RPC_URL != "" { + rpc_url = conf.PRODUCT_RPC_URL + } else { + rpc_url = "127.0.0.1:" + conf.PRODUCT_RPC_PORT } conn, _, err := DialProductService("tcp", rpc_url) if err != nil {