refactor: update environment variable handling to use GetEnvMap for improved type safety and add feature extraction functionality

This commit is contained in:
keven1024
2026-04-04 21:42:25 +08:00
parent 95ab8b97da
commit c50bb5d0bf
5 changed files with 42 additions and 36 deletions

View File

@@ -22,7 +22,7 @@ func TestInitEnvAndGetEnv(t *testing.T) {
ConfigData: bytes.NewBufferString(jsonData),
ConfigType: []string{"json"},
}
utils.InitEnv(props)
utils.InitTestViper(props)
// GetEnv应能拿到值
val := utils.GetEnv("test.value")