Skip to content

support optional section + key/value map as section#18

Open
mandelsoft wants to merge 1 commit intogo-gcfg:v1from
mandelsoft:master
Open

support optional section + key/value map as section#18
mandelsoft wants to merge 1 commit intogo-gcfg:v1from
mandelsoft:master

Conversation

@mandelsoft
Copy link
Copy Markdown

@mandelsoft mandelsoft commented Nov 18, 2019

This pull request provides support for the following missing features:

  • Dynamic Section Content
    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.
  • Dynamic Sub Section Content
    using the type map[string]map[string]string it is possible to catch dynamic sub section content, also.
  • Use of Structs as well as Struct Pointers
    for plain sections as well as sub sections it is possible now to use pointers to structs or structs.
  • Optional Sections
    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 is
    given, but no fields.

There are appropriate examples and tests added.

peterebden added a commit to peterebden/gcfg that referenced this pull request May 5, 2025
Co-authored-by: pebers <pebers@thoughtmachine.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant