Revert "Revert "Revert "feat: Support config files with viper"" (#4693)" (#4695)

This reverts commit 372fb1f345.
This commit is contained in:
Garrett Delfosse
2022-10-21 17:07:38 -04:00
committed by GitHub
parent 372fb1f345
commit e8537067ef
35 changed files with 1089 additions and 921 deletions

View File

@@ -441,10 +441,6 @@ func (g *Generator) buildStruct(obj types.Object, st *types.Struct) (string, err
jsonOptional bool
)
if err == nil {
if jsonTag.Name == "-" {
// Completely ignore this field.
continue
}
jsonName = jsonTag.Name
if len(jsonTag.Options) > 0 && jsonTag.Options[0] == "omitempty" {
jsonOptional = true