bigquery: breaking change to reading into a slice

35 views
Skip to first unread message

Jonathan Amsterdam

unread,
Dec 5, 2016, 5:36:08 PM12/5/16
to google-api-go-announce
You won't notice this change if you create a new []Value for each row you read from a query or table.

Previously, loading values into a list via RowIterator.Next would append to the list. Now it resets the list to zero size first.

Before:

 var v []Value
... it.Next(&v) ... // v == []Value{1}
... it.Next(&v) ... // v == []Value{1, 2}
... it.Next(&v) ... // v == []Value{1, 2, 3}

Now:

 var v []Value
 
... it.Next(&v) ...    // v == []Value{1}
 
... it.Next(&v) ...    // v == []Value{2}
 
... it.Next(&v) ...    // v == []Value{3}



Reply all
Reply to author
Forward
0 new messages