minor fix
This commit is contained in:
parent
e443049df9
commit
5f28280180
1 changed files with 9 additions and 5 deletions
14
generator.go
14
generator.go
|
@ -9,9 +9,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Generator struct {
|
type Generator struct {
|
||||||
data []byte
|
data []byte
|
||||||
dataSize uint32
|
dataSize uint32
|
||||||
position uint32
|
position uint32
|
||||||
mapStruct map[string]interface{}
|
mapStruct map[string]interface{}
|
||||||
arrayStruct []interface{}
|
arrayStruct []interface{}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,9 @@ func (g *Generator) fillAny(any reflect.Value) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
any.Set(slice)
|
if any.CanSet() {
|
||||||
|
any.Set(slice)
|
||||||
|
}
|
||||||
|
|
||||||
case reflect.UnsafePointer:
|
case reflect.UnsafePointer:
|
||||||
addr, err := g.GenerateUInt64()
|
addr, err := g.GenerateUInt64()
|
||||||
|
@ -197,6 +199,8 @@ func (g *Generator) fillAny(any reflect.Value) error {
|
||||||
}
|
}
|
||||||
any.SetPointer(unsafe.Pointer(uintptr(addr)))
|
any.SetPointer(unsafe.Pointer(uintptr(addr)))
|
||||||
|
|
||||||
|
case reflect.Interface:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
panic("unhandled default case")
|
panic("unhandled default case")
|
||||||
}
|
}
|
||||||
|
@ -334,4 +338,4 @@ func (g *Generator) GenerateUInt64() (uint64, error) {
|
||||||
g.position++
|
g.position++
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue