You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
We may be able to simplify the QueryResult interface.
// QueryResult represents one of the results in the response.
type QueryResult interface {
Type() uint32
Bitmap() BitmapResult
CountItems() []CountResultItem
Count() int64
Sum() int64
Changed() bool
}
Because each function is specific to the type, it's effectively an empty interface. And every implementation is left with unused methods:
type QueryResult interface{}
type BitmapResult struct {
QueryResult
Attributes map[string]interface{} `json:"attrs"`
Bits []uint64 `json:"bits"`
Keys []string `json:"keys"`
}
In this case the QueryResult inside the BitmapResult is not really necessary because everything implements the empty interface, but if for some reason QueryResult needs to have a function defined, this would ensure BitmapResult implements the interface.
This is not at all a high priority, but may be worth revisiting at some point.