Skip to content

Commit

Permalink
Improved struct tags
Browse files Browse the repository at this point in the history
Added ability to set `default` and `required` tags for sub structs fields within arrays, slices and maps.
  • Loading branch information
borisershov committed Mar 12, 2019
1 parent 3121166 commit cfd8366
Show file tree
Hide file tree
Showing 4 changed files with 355 additions and 220 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To describe configuration file structure you simply need to define the struct in
- `conf`: defines custom name for an option
- `conf_extraopts`: provides advanced settings for option. This tag may have the following values:
- `required`: option with this tag is mandatory. If it is set, but corresponding option is not defined in the config file, it will cause an error.
- `default`: determines default value for the option. Can be set only for _Int*_, _Uint*_, _Bool_ and _String_ (not within the arrays, maps or slices) types.
- `default`: determines default value for the option.

- **ENV variables as option values**
You may specify the option value as `ENV:VARIABLE_NAME`. It will use the value of the relative environment variable (i.e. _VARIABLE_NAME_) as value for that option.
Expand Down
Loading

0 comments on commit cfd8366

Please sign in to comment.