Config includes all fields now
unless field has "ignored" attribute
This commit is contained in:
parent
2ce470432c
commit
ab364e1908
26
config.go
26
config.go
|
@ -86,17 +86,7 @@ loop_over_fields:
|
|||
}
|
||||
)
|
||||
|
||||
if title != "" || len(attrs) > 0 || len(options) > 0 {
|
||||
// Substitute field name for title if none set
|
||||
if kind != reflect.Struct {
|
||||
cf.Value = val.Interface()
|
||||
}
|
||||
if title == "" {
|
||||
cf.Title = field.Name
|
||||
}
|
||||
if len(options) > 0 {
|
||||
cf.Options = strings.Split(options, sep)
|
||||
}
|
||||
if len(attrs) > 0 {
|
||||
for _, attr := range strings.Split(attrs, sep) {
|
||||
if attr == aRequired {
|
||||
cf.IsRequired = true
|
||||
|
@ -109,9 +99,21 @@ loop_over_fields:
|
|||
}
|
||||
}
|
||||
|
||||
fields = append(fields, cf)
|
||||
}
|
||||
|
||||
// Substitute field name for title if none set
|
||||
if kind != reflect.Struct {
|
||||
cf.Value = val.Interface()
|
||||
}
|
||||
if title == "" {
|
||||
cf.Title = field.Name
|
||||
}
|
||||
if len(options) > 0 {
|
||||
cf.Options = strings.Split(options, sep)
|
||||
}
|
||||
|
||||
fields = append(fields, cf)
|
||||
|
||||
// Recursion here
|
||||
if kind == reflect.Struct {
|
||||
subconf := &config{
|
||||
|
|
Loading…
Reference in New Issue