Skip to content

Commit

Permalink
Merge pull request #10 from MWM-io/dr/iter-to-structs-edit
Browse files Browse the repository at this point in the history
fix: IterToStructs return
  • Loading branch information
Dmouri committed Jan 16, 2024
2 parents 8f76085 + cb4d4f5 commit 5b5ee0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcloud/helpers/spanner/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func GetOneWithIterator(iter *spanner.RowIterator) (row *spanner.Row, exist bool
// IterToStructs is a helper function to process a row iterator and convert each row to a struct
// This function will return an array of structs and/or the spanner error if one occurs.
func IterToStructs[T any](iter *spanner.RowIterator) ([]T, error) {
var results []T
var results = make([]T, 0)

err := iter.Do(func(r *spanner.Row) error {
var dest T
Expand Down

0 comments on commit 5b5ee0b

Please sign in to comment.