support optional section + key/value map as section #18
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.
This pull request provides support for the following missing features:
using the type
map[string]string
it is possible to catch dynamic section content (key/value) pairs.So far only string values are possible. The
Tags
example has been adapted to show real tags.using the type
map[string]map[string]string
it is possible to catch dynamic sub section content, also.for plain sections as well as sub sections it is possible now to use pointers to structs or structs.
for plain sections, the use of a pointer type now allows to identify optional sections. The field is
nil
if the section is not given in the config data. It points to an initial struct, if the section isgiven, but no fields.
There are appropriate examples and tests added.