carrow
carrow copied to clipboard
Generate Append functions by template
This requires a bit more refactoring in the C side in order to get a generic structure for this type of functions.
For example:
func (b *TimestampArrayBuilder) Append(val time.Time) error {
r := C.array_builder_append_timestamp(b.ptr, C.longlong(val.UnixNano()))
if r.err != nil {
return errFromResult(r)
}
return nil
}
Go type: time.Time
C.array_builder_append_timestamp
should pass a pointer (and the C function will cast it) val.UnixNano should be defined as a Mutator function for the template.