Fix record-value setting
This commit is contained in:
@@ -68,9 +68,11 @@ func (t *{{ $exprType }}) Assign(val interface{}) (error) {
|
||||
|
||||
|
||||
{{ if $def.Struct }}
|
||||
{{ if not $def.CustomFieldAssigner }}
|
||||
func (t *{{ $exprType }}) AssignFieldValue(key string, val interface{}) error {
|
||||
return {{ $def.AssignerFn }}(t.value, key, val)
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $def.CustomGValSelector }}
|
||||
// SelectGVal implements gval.Selector requirements
|
||||
|
||||
@@ -23,13 +23,14 @@ type (
|
||||
}
|
||||
|
||||
exprTypeDef struct {
|
||||
As string
|
||||
RawDefault string `yaml:"default"`
|
||||
AssignerFn string `yaml:"assignerFn"`
|
||||
BuiltInCastFn bool
|
||||
BuiltInAssignerFn bool
|
||||
CustomGValSelector bool `yaml:"customGValSelector"`
|
||||
Struct []*exprTypeStructDef
|
||||
As string
|
||||
RawDefault string `yaml:"default"`
|
||||
AssignerFn string `yaml:"assignerFn"`
|
||||
BuiltInCastFn bool
|
||||
BuiltInAssignerFn bool
|
||||
CustomGValSelector bool `yaml:"customGValSelector"`
|
||||
CustomFieldAssigner bool `yaml:"customFieldAssigner"`
|
||||
Struct []*exprTypeStructDef
|
||||
|
||||
// @todo custom setters
|
||||
// @todo custom getters
|
||||
|
||||
Reference in New Issue
Block a user