MarkJoyMa 2 years ago committed by Kevin Wan
parent 1ad7809fde
commit 7086fb6dda

@ -712,7 +712,7 @@ func (u *Unmarshaler) processNamedField(field reflect.StructField, value reflect
valuer := createValuer(m, opts) valuer := createValuer(m, opts)
mapValue, hasValue := getValue(valuer, canonicalKey) mapValue, hasValue := getValue(valuer, canonicalKey)
// When fillDefault is used, m is a null value, hasValue must be false, all priority judgments fillDefault, // When fillDefault is used, m is a null value, hasValue must be false, all priority judgments fillDefault.
if u.opts.fillDefault { if u.opts.fillDefault {
if !value.IsZero() { if !value.IsZero() {
return fmt.Errorf("set the default value, %s must be zero", fullName) return fmt.Errorf("set the default value, %s must be zero", fullName)

@ -12,7 +12,6 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/stringx" "github.com/zeromicro/go-zero/core/stringx"
) )

Loading…
Cancel
Save