The following code (or any other array/slice type!):
var t []uuid.UUID
tx.QueryRow(ctx, `select '{}'::uuid[]`).Scan(&t)
Causes the src struct in the AssignTo function to have Elements and Dimensions set as nil, but Status as Present.
The proposed solution:
Adds checks for nil or zero length elements or dimensions in the AssignTo function where the src is marked as Present, but the Elements or Dimensions are nil.
Returns immediately for nil and zero length arrays and slices.
Adds the above issue as test cases for all array types.
Only 4 lines of new code in typed_array.go.erb + test cases.
Fixes #68
The problem:
The following code (or any other array/slice type!):
Causes the
src
struct in theAssignTo
function to haveElements
andDimensions
set asnil
, butStatus
asPresent
.The proposed solution:
AssignTo
function where thesrc
is marked asPresent
, but theElements
orDimensions
arenil
.typed_array.go.erb
+ test cases.