From bb1e77e8cddade45563d93c60b1f27779b937163 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Wed, 11 Sep 2024 11:09:16 -0600 Subject: [PATCH] Hide all Result fields --- gigaparsec.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gigaparsec.go b/gigaparsec.go index d89cf07..e8061c8 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -11,16 +11,16 @@ import ( type Result[In, Out any] struct { consumed, failed bool - Value Out + value Out next State[In] - Message Message + message Message } func Fail[In, Out any](consumed bool, msg Message) Result[In, Out] { return Result[In, Out]{ consumed: consumed, failed: true, - Message: msg, + message: msg, } } @@ -28,7 +28,7 @@ func (r Result[In, Out]) Failed() (ok, consumed bool, msg Message) { ok = r.failed if ok { consumed = r.consumed - msg = r.Message + msg = r.message } return } @@ -36,10 +36,10 @@ func (r Result[In, Out]) Failed() (ok, consumed bool, msg Message) { func Succeed[In, Out any](consumed bool, value Out, next State[In], msg Message) Result[In, Out] { return Result[In, Out]{ failed: false, - Value: value, + value: value, consumed: consumed, next: next, - Message: msg, + message: msg, } } @@ -47,9 +47,9 @@ func (r Result[In, Out]) Succeeded() (ok, consumed bool, value Out, next State[I ok = !r.failed if ok { consumed = r.consumed - value = r.Value + value = r.value next = r.next - msg = r.Message + msg = r.message } return }