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

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

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{