From 8e8ecd9b85c5c829dc7032e3432c2096f112c743 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Tue, 16 Apr 2019 17:50:43 -0700 Subject: [PATCH] go: fix ignored page token bug in iterator --- src/main/resources/com/google/api/codegen/go/main.snip | 1 + .../google/api/codegen/gapic/testdata/go/go_library.baseline | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/resources/com/google/api/codegen/go/main.snip b/src/main/resources/com/google/api/codegen/go/main.snip index 0b5edfbc78..eb79a4ea56 100644 --- a/src/main/resources/com/google/api/codegen/go/main.snip +++ b/src/main/resources/com/google/api/codegen/go/main.snip @@ -270,6 +270,7 @@ } it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) it.pageInfo.MaxSize = int(req.PageSize) + it.pageInfo.Token = req.PageToken return it } @end diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/go/go_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/go/go_library.baseline index 715ec6c80f..c7c0d17276 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/go/go_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/go/go_library.baseline @@ -456,6 +456,7 @@ func (c *LibClient) ListShelves(ctx context.Context, req *librarypb.ListShelvesR } it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) it.pageInfo.MaxSize = int(req.PageSize) + it.pageInfo.Token = req.PageToken return it } @@ -577,6 +578,7 @@ func (c *LibClient) ListBooks(ctx context.Context, req *librarypb.ListBooksReque } it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) it.pageInfo.MaxSize = int(req.PageSize) + it.pageInfo.Token = req.PageToken return it } @@ -661,6 +663,7 @@ func (c *LibClient) ListStrings(ctx context.Context, req *librarypb.ListStringsR } it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) it.pageInfo.MaxSize = int(req.PageSize) + it.pageInfo.Token = req.PageToken return it } @@ -841,6 +844,7 @@ func (c *LibClient) FindRelatedBooks(ctx context.Context, req *librarypb.FindRel } it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) it.pageInfo.MaxSize = int(req.PageSize) + it.pageInfo.Token = req.PageToken return it }