Skip to content

Commit 303bf8a

Browse files
authored
remove case for map[string]interface from switch statement in AllPages (#276)
1 parent 885e72e commit 303bf8a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎pagination/pager.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,8 @@ func (p Pager) AllPages() (Page, error) {
155155
for k, v := range b {
156156
// If it's a linked page, we don't want the `links`, we want the other one.
157157
if !strings.HasSuffix(k, "links") {
158+
// check the field's type. we only want []interface{} (which is really []map[string]interface{})
158159
switch vt := v.(type) {
159-
case map[string]interface{}:
160-
key = k
161-
pagesSlice = append(pagesSlice, vt)
162160
case []interface{}:
163161
key = k
164162
pagesSlice = append(pagesSlice, vt...)

0 commit comments

Comments
 (0)