diff --git a/c_glib/example/go/write-batch.go b/c_glib/example/go/write-batch.go index f5e946a0c5c..78ef1beca4f 100644 --- a/c_glib/example/go/write-batch.go +++ b/c_glib/example/go/write-batch.go @@ -149,14 +149,20 @@ func main() { } recordBatch := arrow.NewRecordBatch(schema, 4, columns) - writer.WriteRecordBatch(recordBatch) + _, err = writer.WriteRecordBatch(recordBatch) + if err != nil { + log.Fatalf("Failed to write record batch #1: %v", err) + } slicedColumns := make([]*arrow.Array, len(columns)) for i, column := range columns { slicedColumns[i] = column.Slice(1, 3) } recordBatch = arrow.NewRecordBatch(schema, 3, slicedColumns) - writer.WriteRecordBatch(recordBatch) + _, err = writer.WriteRecordBatch(recordBatch) + if err != nil { + log.Fatalf("Failed to write record batch #2: %v", err) + } writer.Close() } diff --git a/c_glib/example/go/write-stream.go b/c_glib/example/go/write-stream.go index 80ebd2ba1b0..3f082702757 100644 --- a/c_glib/example/go/write-stream.go +++ b/c_glib/example/go/write-stream.go @@ -149,7 +149,10 @@ func main() { } recordBatch := arrow.NewRecordBatch(schema, 4, columns) - writer.WriteRecordBatch(recordBatch) + _, err = writer.WriteRecordBatch(recordBatch) + if err != nil { + log.Fatalf("Failed to write record batch #1: %v", err) + } slicedColumns := make([]*arrow.Array, len(columns)) for i, column := range columns { @@ -157,6 +160,10 @@ func main() { } recordBatch = arrow.NewRecordBatch(schema, 3, slicedColumns) writer.WriteRecordBatch(recordBatch) + _, err = writer.WriteRecordBatch(recordBatch) + if err != nil { + log.Fatalf("Failed to write record batch #2: %v", err) + } writer.Close() }