Skip to content

Commit 265bfde

Browse files
committed
fix: correct to the right viper env key format
1 parent 9ed4908 commit 265bfde

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.todo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
[?] loft 调研
3535
[?] onex-apiserver 后端对接 ES
3636
[?] 诊断平台
37-
37+
[?] GraphQL API
3838
---
3939

4040
[?] 创建一个项目开发者社区网站 + 群???

internal/onexctl/cmd/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func initConfig(cfgFile string) {
5454
viper.SetEnvPrefix("ONEX")
5555

5656
// 以下 2 行,将 viper.Get(key) key 字符串中 '.' 和 '-' 替换为 '_'
57-
replacer := strings.NewReplacer(".", "_")
57+
replacer := strings.NewReplacer(".", "_", "-", "_")
5858
viper.SetEnvKeyReplacer(replacer)
5959

6060
// 读取配置文件。如果指定了配置文件名,则使用指定的配置文件,否则在注册的搜索路径中搜索

0 commit comments

Comments
 (0)