Fix config struct processing, add (much needed) tests #174
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.
Added
in order to allow early failure
Changed
config.logBuffer
moved tologging.LogBuffer
io.Reader
instead of filename so that we can usean in-memory TOML config file for testing config parsing
and precedence validation
related code easier to manage
to continue.
struct fields in the majority of the code
Config{}
(see Consider breaking dependency between config package and other subpackages #170)Deprecated
Both of these functions from the
config
package do not appearto be needed any longer, but are being kept for a cycle in case
I change my mind:
Config.SetDefaultConfig()
Config.GetStructTag()
Fixed
settings are allowed to override lower precedence config
sources
default
switch statements along with errorreturn codes for
Set
functions with specific valid option valuesTODO
specific checks (which ends up being very lengthy)
TestValidate()
References