Skip to content

Commit e22b61e

Browse files
committed
Revert "fix: handle invalid values in Decoder's decode method"
This reverts commit 3b918fb.
1 parent 3b918fb commit e22b61e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

common/structure/structure.go

-5
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ func (d *Decoder) Decode(src map[string]any, dst any) error {
8787
}
8888

8989
func (d *Decoder) decode(name string, data any, val reflect.Value) error {
90-
if !val.IsValid() {
91-
// TODO: Why is an invalid value generated?
92-
// If an invalid value is passed to `decodeString`, it will panic due to the call to `Type()`.
93-
return fmt.Errorf("'%s' is not valid", name)
94-
}
9590
for {
9691
kind := val.Kind()
9792
if kind == reflect.Pointer && val.IsNil() {

0 commit comments

Comments
 (0)