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 --- combinator_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'combinator_test.go') diff --git a/combinator_test.go b/combinator_test.go index 1c95eba..c1eedb3 100644 --- a/combinator_test.go +++ b/combinator_test.go @@ -165,8 +165,8 @@ type htmlTag struct { } func TestMap(t *testing.T) { - parser := Map(Seq("<", Chars("a-zA-Z0-9"), ">"), func(n Result) Result { - return Result{Result: htmlTag{n.Child[1].Token}} + parser := Seq("<", Chars("a-zA-Z0-9"), ">").Map(func(n *Result) { + n.Result = htmlTag{n.Child[1].Token} }) t.Run("success", func(t *testing.T) { @@ -235,8 +235,8 @@ func TestMerge(t *testing.T) { } func TestMapShorthand(t *testing.T) { - Chars("a-z").Map(func(n Result) Result { - return Result{Result: n.Token} + Chars("a-z").Map(func(n *Result) { + n.Result = n.Token }) } -- cgit v1.2.3