From 6c0b5f197faa1a73eceb22d2289b0cd779d9fdee Mon Sep 17 00:00:00 2001 From: Rached Ben Ayed Date: Tue, 12 Dec 2023 09:39:33 +0100 Subject: [PATCH] fix: IterToStruct check error --- gcloud/helpers/spanner/iter.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcloud/helpers/spanner/iter.go b/gcloud/helpers/spanner/iter.go index 476bc38..cdf6db7 100644 --- a/gcloud/helpers/spanner/iter.go +++ b/gcloud/helpers/spanner/iter.go @@ -38,8 +38,7 @@ func IterToStructs[T any](iter *spanner.RowIterator) ([]T, error) { // You can use it to simplify your code when you know there is only one row in the iterator. func IterToStruct[T any](iter *spanner.RowIterator) (result T, exist bool, err error) { results, errIter := IterToStructs[T](iter) - - if err != nil { + if errIter != nil { return result, false, errIter }