修复 GetWithEnv 获取配置文件配置的变量名转换问题#4748
Open
webguosai wants to merge 1 commit into
Open
Conversation
- 修复:gogf/gf-site#244 (comment) - 问题描述:按文档所说的,先查找配置文件中的配置,然后再找env环境变量中的配置,这里发现查找配置文件中的变量未转换:名称转换为小写,名称中的_字符转换为.字符,所以当我传入名称:SERVER_ADDRESS,在配置文件中查找的配置仍为:SERVER_ADDRESS,而不是:server.address
Author
|
补充一下,我觉得获取配置应该先从环境变量中获取,如果环境变量中没有,再从配置中读取,会不会更符合呢 |
Contributor
历史遗留包袱,可参考最新getEffective |
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.
Please ensure you adhere to every item in this list.
<type>[optional scope]: <description>For example,fix(os/gtime): fix time zone issue<type>is mandatory and can be one offix,feat,build,ci,docs,style,refactor,perf,test,chorefix: Used when a bug has been fixed.feat: Used when a new feature has been added.build: Used for modifications to the project build system, such as changes to dependencies, external interfaces, or upgrading Node version.ci: Used for modifications to continuous integration processes, such as changes to Travis, Jenkins workflow configurations.docs: Used for modifications to documentation, such as changes to README files, API documentation, etc.style: Used for changes to code style, such as adjustments to indentation, spaces, blank lines, etc.refactor: Used for code refactoring, such as changes to code structure, variable names, function names, without altering functionality.perf: Used for performance optimization, such as improving code performance, reducing memory usage, etc.test: Used for modifications to test cases, such as adding, deleting, or modifying test cases for code.chore: Used for modifications to non-business-related code, such as changes to build processes or tool configurations.<type>, specify the affected package name or scope in parentheses, for example,(os/gtime).Fixes #1234orUpdates #1234(the latter if this is not a complete fix) to this comment
提交前请遵守每个事项,感谢!
<类型>[可选 范围]: <描述>例如fix(os/gtime): fix time zone issue<类型>是必须的,可以是fix、feat、build、ci、docs、style、refactor、perf、test、chore中的一个<类型>后在括号中填写受影响的包名或范围,例如(os/gtime)Fixes #1234,如果不是完全修复则添加Updates #1234