mirror of https://github.com/tidwall/tile38.git
fixed resp count
This commit is contained in:
parent
afa15461de
commit
97332cc3e1
|
@ -14,6 +14,8 @@ import (
|
|||
"github.com/tidwall/tile38/controller/server"
|
||||
)
|
||||
|
||||
// MASSINSERT num_keys num_points [minx miny maxx maxy]
|
||||
|
||||
const useRandField = true
|
||||
|
||||
func randMassInsertPosition(minLat, minLon, maxLat, maxLon float64) (float64, float64) {
|
||||
|
|
|
@ -154,11 +154,17 @@ func (sw *scanWriter) writeFoot(cursor uint64) {
|
|||
sw.wr.WriteString(`,"cursor":` + strconv.FormatUint(cursor, 10))
|
||||
case server.RESP:
|
||||
sw.wr.Reset()
|
||||
var data []byte
|
||||
var err error
|
||||
if sw.output == outputCount {
|
||||
data, err = resp.IntegerValue(int(sw.count)).MarshalRESP()
|
||||
} else {
|
||||
values := []resp.Value{
|
||||
resp.IntegerValue(int(cursor)),
|
||||
resp.ArrayValue(sw.values),
|
||||
}
|
||||
data, err := resp.ArrayValue(values).MarshalRESP()
|
||||
data, err = resp.ArrayValue(values).MarshalRESP()
|
||||
}
|
||||
if err != nil {
|
||||
panic("Eek this is bad. Marshal resp should not fail.")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue