storage: fix bucketiterator next
Fixes #1628
Change-Id: I990227a6ce15a957a7ba0b8d534617d779a0b841
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/47131
Reviewed-by: Cody Oss <codyoss@google.com>
Reviewed-by: James Hartig <fastest963@gmail.com>
diff --git a/storage/bucket.go b/storage/bucket.go
index 15cb01e..fe080bf 100644
--- a/storage/bucket.go
+++ b/storage/bucket.go
@@ -1168,9 +1168,9 @@
if err := it.nextFunc(); err != nil {
return nil, err
}
- item := it.items[0]
- it.items = it.items[1:]
- return item, nil
+ b := it.buckets[0]
+ it.buckets = it.buckets[1:]
+ return b, nil
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.