mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
feat: validate value in options for mapping (#2616)
This commit is contained in:
@@ -341,6 +341,10 @@ func (u *Unmarshaler) processFieldTextUnmarshaler(field reflect.StructField, val
|
||||
|
||||
func (u *Unmarshaler) processFieldWithEnvValue(field reflect.StructField, value reflect.Value,
|
||||
envVal string, opts *fieldOptionsWithContext, fullName string) error {
|
||||
if err := validateValueInOptions(envVal, opts.options()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fieldKind := field.Type.Kind()
|
||||
switch fieldKind {
|
||||
case reflect.Bool:
|
||||
|
||||
Reference in New Issue
Block a user