From 5e25e8ecccab29c3650c7cb231a5fec016ebee19 Mon Sep 17 00:00:00 2001 From: yanweidong Date: Sat, 20 Sep 2025 11:08:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(with/etcd):=20=E4=BF=AE=E6=94=B9Etcd?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当Etcd配置或端点为空时,将panic改为直接返回,避免程序崩溃 --- with/etcd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/with/etcd.go b/with/etcd.go index 9ac0a87..0524584 100644 --- a/with/etcd.go +++ b/with/etcd.go @@ -13,7 +13,7 @@ import ( func Etcd(cfg *conf.EtcdConf, cli *clientv3.Client) { if cfg == nil || len(cfg.Endpoints) == 0 { - panic("Etcd endpoints is Empty!") + return } etcdCfg := clientv3.Config{