You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/05/11 20:02:08 UTC

arrow git commit: ARROW-993: [GLib] Add missing error checks in Go examples

Repository: arrow
Updated Branches:
  refs/heads/master 1c6f3ef82 -> a7722dc14


ARROW-993: [GLib] Add missing error checks in Go examples

Author: Kouhei Sutou <ko...@clear-code.com>

Closes #666 from kou/glib-example-go-add-missing-error-handling and squashes the following commits:

7baa8ba [Kouhei Sutou] [GLib] Add missing error checks in Go examples


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/a7722dc1
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/a7722dc1
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/a7722dc1

Branch: refs/heads/master
Commit: a7722dc14527e7424179637cddc4d2d656562143
Parents: 1c6f3ef
Author: Kouhei Sutou <ko...@clear-code.com>
Authored: Thu May 11 16:02:03 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Thu May 11 16:02:03 2017 -0400

----------------------------------------------------------------------
 c_glib/example/go/write-batch.go  | 10 ++++++++--
 c_glib/example/go/write-stream.go |  9 ++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/a7722dc1/c_glib/example/go/write-batch.go
----------------------------------------------------------------------
diff --git a/c_glib/example/go/write-batch.go b/c_glib/example/go/write-batch.go
index f5e946a..78ef1be 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()
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/a7722dc1/c_glib/example/go/write-stream.go
----------------------------------------------------------------------
diff --git a/c_glib/example/go/write-stream.go b/c_glib/example/go/write-stream.go
index 80ebd2b..3f08270 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()
 }