Skip to content

Commit

Permalink
Merge pull request #110 from cycloidio/fg-fix-pagination
Browse files Browse the repository at this point in the history
Fix: aws pagination error
  • Loading branch information
xescugc authored Jun 2, 2020
2 parents 86d8875 + d73ba63 commit bcbde16
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aws/cmd/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const (
{{ if .HasNotPagination }}
hasNextToken = false
{{ else }}
if input == nil {
input = &{{.Input}}{}
}
input.{{.InputPaginationAttributeFn}} = o.{{.PaginationAttributeFn}}
hasNextToken = o.{{.PaginationAttributeFn}} != nil
{{ end }}
Expand Down
6 changes: 6 additions & 0 deletions aws/cmd/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ func TestTemplateExecute(t *testing.T) {
if err != nil {
return nil, err
}
if input == nil {
input = &Service.PrefixEntitiesInput{}
}
input.NextToken = o.NextToken
hasNextToken = o.NextToken != nil
Expand Down Expand Up @@ -197,6 +200,9 @@ func TestTemplateExecute(t *testing.T) {
if err != nil {
return nil, err
}
if input == nil {
input = &Service.PrefixEntitiesInput{}
}
input.NextToken = o.NextToken
hasNextToken = o.NextToken != nil
Expand Down
Loading

0 comments on commit bcbde16

Please sign in to comment.