mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
feat: Support config files with viper (#4558)
This commit is contained in:
@ -441,6 +441,10 @@ 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
|
||||
|
Reference in New Issue
Block a user