From edc4838077ff0dbe72cb1535b7701be43540ecbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 27 Nov 2019 17:10:51 +0100 Subject: [PATCH] query: always return the size fix #34 --- datastore.go | 2 +- go.mod | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/datastore.go b/datastore.go index 6f8a610..b017230 100644 --- a/datastore.go +++ b/datastore.go @@ -133,7 +133,7 @@ func (a *accessor) Query(q dsq.Query) (dsq.Results, error) { return dsq.Result{}, false } k := string(i.Key()) - e := dsq.Entry{Key: k} + e := dsq.Entry{Key: k, Size: len(i.Value())} if !q.KeysOnly { buf := make([]byte, len(i.Value())) diff --git a/go.mod b/go.mod index 360fd10..3175024 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,6 @@ require ( github.com/syndtr/goleveldb v1.0.0 ) +replace github.com/ipfs/go-datastore => github.com/MichaelMure/go-datastore v0.1.1-0.20191122134937-68a77964d1eb + go 1.13