From be342f660a336c88bc7f442cb2b4628675883a34 Mon Sep 17 00:00:00 2001 From: sebastiano Date: Tue, 28 Feb 2023 11:54:05 +0100 Subject: [PATCH] remove fieldValue fields. --- example/main.go | 8 +++++--- fields.go | 2 -- transformer.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/main.go b/example/main.go index 014868e..5865fe2 100644 --- a/example/main.go +++ b/example/main.go @@ -12,8 +12,9 @@ var inputTpl = `
{{ if eq .Type "dropdown" }} {{ else if eq .Type "checkbox" }} @@ -79,8 +80,9 @@ func main() { State: "NY", Zip: "11765", }, - CheckBox: true, - CheckBox2: false, + InputTypes: form.InputFieldTypeEmail, + CheckBox: true, + CheckBox2: false, }, Errors: []form.FieldError{ fieldError{ diff --git a/fields.go b/fields.go index 34e3548..669540b 100644 --- a/fields.go +++ b/fields.go @@ -40,11 +40,9 @@ func (i InputFieldType) Enum() []any { } type FieldValue struct { - Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Disabled bool `json:"disabled,omitempty"` - Group string `json:"group,omitempty"` } type FormField struct { diff --git a/transformer.go b/transformer.go index 12c78ea..3f58644 100644 --- a/transformer.go +++ b/transformer.go @@ -80,7 +80,7 @@ func (t *Transformer) scanModel(rValue reflect.Value, rType reflect.Type, names var fieldValue []FieldValue for _, v := range enums { fieldValue = append(fieldValue, FieldValue{ - Id: fmt.Sprint(v), + Value: fmt.Sprint(v), Name: fmt.Sprint(v), Disabled: false, })