mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Revert "Revert "feat: Support config files with viper"" (#4693)
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