Open
Conversation
如环境变量为:CONFIG_TEST,则可以通过config.test,进行查询
Member
|
请描述user story |
Contributor
Author
在Linux的习惯里,环境变量均为大写,如SERVER_ADDR,而配置文件中一般为小写,如:server.addr,为了能够通过archaius来屏蔽配置环境变量与其他配置源在读配置上的差异性,希望把环境变量的每个字段都换成小写,这样就可以用同一种key的格式来获取配置,并兼顾环境变量和配置文件,这个在UnmarshalConfig方式里更能体现 |
| @@ -0,0 +1,10 @@ | |||
|
|
|||
Member
在这个位置补充下使用文档 Line 111 in 2b7c9e9 |
| } | ||
| if o.UseENVSource { | ||
| envSource := env.NewEnvConfigurationSource() | ||
| envSource := env.NewEnvConfigurationSource(o.EnvKeyLowerCases) |
Member
There was a problem hiding this comment.
不建议改变现有API了,我担心已经有人调用了,写新函数EnableLowerCase吧
| @@ -0,0 +1,3 @@ | |||
|
|
|||
| age: 14 | |||
Member
There was a problem hiding this comment.
这些测试文件都放到test目录,或者别传上来,或者用go的新特性,tmpdir来写文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
如环境变量为:CONFIG_TEST,则可以通过config.test,进行查询