minor fix

This commit is contained in:
Evgeny Bukreev 2024-06-05 11:32:11 +03:00
parent e443049df9
commit 5f28280180
Failed to extract signature

View file

@ -9,9 +9,9 @@ import (
)
type Generator struct {
data []byte
dataSize uint32
position uint32
data []byte
dataSize uint32
position uint32
mapStruct map[string]interface{}
arrayStruct []interface{}
}
@ -188,7 +188,9 @@ func (g *Generator) fillAny(any reflect.Value) error {
return err
}
}
any.Set(slice)
if any.CanSet() {
any.Set(slice)
}
case reflect.UnsafePointer:
addr, err := g.GenerateUInt64()
@ -197,6 +199,8 @@ func (g *Generator) fillAny(any reflect.Value) error {
}
any.SetPointer(unsafe.Pointer(uintptr(addr)))
case reflect.Interface:
default:
panic("unhandled default case")
}
@ -334,4 +338,4 @@ func (g *Generator) GenerateUInt64() (uint64, error) {
g.position++
}
return result, nil
}
}