make prev/next links omitempty
parent
6d27a08208
commit
75ce16b633
|
|
@ -70,7 +70,6 @@ func TestService_handleGetBuckets(t *testing.T) {
|
|||
body: `
|
||||
{
|
||||
"links": {
|
||||
"prev": "",
|
||||
"self": "/api/v2/buckets?descending=false&limit=1&offset=0",
|
||||
"next": "/api/v2/buckets?descending=false&limit=1&offset=1"
|
||||
},
|
||||
|
|
@ -122,9 +121,7 @@ func TestService_handleGetBuckets(t *testing.T) {
|
|||
body: `
|
||||
{
|
||||
"links": {
|
||||
"prev": "",
|
||||
"self": "/api/v2/buckets?descending=false&limit=1&offset=0",
|
||||
"next": ""
|
||||
"self": "/api/v2/buckets?descending=false&limit=1&offset=0"
|
||||
},
|
||||
"buckets": []
|
||||
}`,
|
||||
|
|
@ -166,7 +163,6 @@ func TestService_handleGetBuckets(t *testing.T) {
|
|||
if eq, _ := jsonEqual(string(body), tt.wants.body); tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetBuckets() = \n***%v***\n,\nwant\n***%v***", tt.name, string(body), tt.wants.body)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ type PagingFilter interface {
|
|||
|
||||
// PagingLinks represents paging links.
|
||||
type PagingLinks struct {
|
||||
Prev string `json:"prev"`
|
||||
Prev string `json:"prev,omitempty"`
|
||||
Self string `json:"self"`
|
||||
Next string `json:"next"`
|
||||
Next string `json:"next,omitempty"`
|
||||
}
|
||||
|
||||
// FindOptions represents options passed to all find methods with multiple results.
|
||||
|
|
|
|||
Loading…
Reference in New Issue