Skip to content

Commit

Permalink
Revert "fix: handle invalid values in Decoder's decode method"
Browse files Browse the repository at this point in the history
This reverts commit 3b918fb.
  • Loading branch information
Skyxim committed Dec 15, 2024
1 parent 3b918fb commit e22b61e
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions common/structure/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ func (d *Decoder) Decode(src map[string]any, dst any) error {
}

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

0 comments on commit e22b61e

Please # to comment.