From 5716ddb5e7ca3cb4ee445bdd4958c37aeb033baa Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 13 Aug 2017 17:30:10 +1000 Subject: Pass result in instead of returning --- json/json.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'json/json.go') diff --git a/json/json.go b/json/json.go index 7cc53a1..9b1e8e9 100644 --- a/json/json.go +++ b/json/json.go @@ -13,22 +13,22 @@ var ( _number = NumberLit() _properties = Some(Seq(StringLit(`"`), ":", &_value), ",") - _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n Result) Result { + _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n *Result) { ret := []interface{}{} for _, child := range n.Child[2].Child { ret = append(ret, child.Result) } - return Result{Result: ret} + n.Result = ret }) - _object = Seq("{", Cut(), _properties, "}").Map(func(n Result) Result { + _object = Seq("{", Cut(), _properties, "}").Map(func(n *Result) { ret := map[string]interface{}{} for _, prop := range n.Child[2].Child { ret[prop.Child[0].Result.(string)] = prop.Child[2].Result } - return Result{Result: ret} + n.Result = ret }) ) -- cgit v1.2.3