diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-13 12:56:46 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-13 13:00:22 +1000 |
commit | 77930f8f066b058c7e6cbae015523370ca3dab7e (patch) | |
tree | fd0e4e3663f1183633fb16be297a20764a38d37c /json | |
parent | f5b81e8e2eebd06e79159eaa3e721ac59ba3cc8c (diff) |
Add map shorthand
Diffstat (limited to 'json')
-rw-r--r-- | json/json.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/json/json.go b/json/json.go index 172099c..7cc53a1 100644 --- a/json/json.go +++ b/json/json.go @@ -13,7 +13,7 @@ var ( _number = NumberLit() _properties = Some(Seq(StringLit(`"`), ":", &_value), ",") - _array = Map(Seq("[", Cut(), Some(&_value, ","), "]"), func(n Result) Result { + _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n Result) Result { ret := []interface{}{} for _, child := range n.Child[2].Child { ret = append(ret, child.Result) @@ -21,7 +21,7 @@ var ( return Result{Result: ret} }) - _object = Map(Seq("{", Cut(), _properties, "}"), func(n Result) Result { + _object = Seq("{", Cut(), _properties, "}").Map(func(n Result) Result { ret := map[string]interface{}{} for _, prop := range n.Child[2].Child { |