Initial avro reader complete

This commit is contained in:
Aditya Ujeniya
2025-05-19 09:28:30 +02:00
parent 8098417f78
commit 968940da1f
8 changed files with 352 additions and 154 deletions

View File

@@ -49,6 +49,14 @@ func (f *Float) UnmarshalJSON(input []byte) error {
// Same as `[]Float`, but can be marshaled to JSON with less allocations.
type FloatArray []Float
func ConvertToFloat(input float64) Float {
if input == -1.0 {
return NaN
} else {
return Float(input)
}
}
func (fa FloatArray) MarshalJSON() ([]byte, error) {
buf := make([]byte, 0, 2+len(fa)*8)
buf = append(buf, '[')