From 0c9bced44e5929613f78d9a74f0c3e9904e9f662 Mon Sep 17 00:00:00 2001 From: lmk <1095689763@qq.com> Date: Fri, 10 Apr 2026 16:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E9=85=8D=E7=BD=AE=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consul/consul.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/consul/consul.go b/consul/consul.go index 42c1dfa..0e68817 100644 --- a/consul/consul.go +++ b/consul/consul.go @@ -151,8 +151,7 @@ func loadConfigFromConsul() { fmt.Printf("服务名称: %s, 环境变量 APP_ENV: %s\n", serviceName, env) if env == "" { - fmt.Printf("未设置 APP_ENV 环境变量,跳过 Consul 配置加载\n") - return + panic("未设置 APP_ENV 环境变量,无法从 Consul 加载配置") } consulData, lastIndex, err := loadEnvFromConsul(env, serviceName)