default IsEmpty func for Pages
diff --git a/pagination/single_test.go b/pagination/single_test.go
index b5874cc..2a9466c 100644
--- a/pagination/single_test.go
+++ b/pagination/single_test.go
@@ -5,7 +5,6 @@
"net/http"
"testing"
- "github.com/mitchellh/mapstructure"
"github.com/gophercloud/gophercloud/testhelper"
)
@@ -23,17 +22,12 @@
return len(is) == 0, nil
}
-func ExtractSingleInts(page Page) ([]int, error) {
- var response struct {
- Ints []int `mapstructure:"ints"`
+func ExtractSingleInts(r Page) ([]int, error) {
+ var s struct {
+ Ints []int `json:"ints"`
}
-
- err := mapstructure.Decode(page.(SinglePageResult).Body, &response)
- if err != nil {
- return nil, err
- }
-
- return response.Ints, nil
+ err := (r.(SinglePageResult)).ExtractInto(&s)
+ return s.Ints, err
}
func setupSinglePaged() Pager {