summaryrefslogtreecommitdiff
path: root/src/lib/json/generic.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/json/generic.go')
-rw-r--r--src/lib/json/generic.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/json/generic.go b/src/lib/json/generic.go
index 4393e4d08..e3194eb17 100644
--- a/src/lib/json/generic.go
+++ b/src/lib/json/generic.go
@@ -33,7 +33,7 @@ type Json interface {
Bool() bool; // boolean (BoolKind)
Get(s string) Json; // field lookup (MapKind)
Elem(i int) Json; // element lookup (ArrayKind)
- Len() int; // length (ArrayKind)
+ Len() int; // length (ArrayKind, MapKind)
}
// JsonToString returns the textual JSON syntax representation
@@ -112,6 +112,7 @@ func (j *_Bool) String() string {
type _Map struct { m map[string]Json; _Null }
func (j *_Map) Kind() int { return MapKind }
+func (j *_Map) Len() int { return len(j.m) }
func (j *_Map) Get(s string) Json {
if j.m == nil {
return Null