fix(with/etcd): 修改Etcd配置为空时的处理逻辑

当Etcd配置或端点为空时,将panic改为直接返回,避免程序崩溃
This commit is contained in:
yanweidong 2025-09-20 11:08:47 +08:00
parent 4f584726d6
commit 5e25e8eccc
1 changed files with 1 additions and 1 deletions

View File

@ -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{