From a8a7f8aea2f37e3f8bc5ea9bcbdb831d82501ca2 Mon Sep 17 00:00:00 2001 From: Hikmatulloh Hari Mukti Date: Tue, 2 Jul 2024 18:23:24 +0700 Subject: [PATCH] fix: misspell --- exp/explain/explain.go | 4 ++-- exp/explain/visitor.go | 6 +++--- exp/explain/visitor_test.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exp/explain/explain.go b/exp/explain/explain.go index 2eced51..50ce8d4 100644 --- a/exp/explain/explain.go +++ b/exp/explain/explain.go @@ -22,7 +22,7 @@ import ( // One step can have multiple equivalent forms, starts with original form until the final form. type Step struct { EquivalentForms []string - Explaination string + Explanation string Result string } @@ -43,7 +43,7 @@ func Explain(s string) ([]Step, error) { for _, transform := range v.transforms { step := Step{ EquivalentForms: []string{transform.Segmented}, - Explaination: transform.Explaination, + Explanation: transform.Explanation, Result: transform.Evaluated, } if transform.Segmented != transform.EquivalentForm { diff --git a/exp/explain/visitor.go b/exp/explain/visitor.go index e4834a7..0a6efd0 100644 --- a/exp/explain/visitor.go +++ b/exp/explain/visitor.go @@ -39,7 +39,7 @@ const ( type Transform struct { Segmented string EquivalentForm string - Explaination string + Explanation string Evaluated string } @@ -212,7 +212,7 @@ func explainBitwise(transform *Transform, xValue, yValue string, op token.Token) ybits := fmt.Sprintf(formatter, int64(fy)) if op != token.SHL && op != token.SHR { - transform.Explaination = fmt.Sprintf("%s\n%s\n%s %s\n%s", + transform.Explanation = fmt.Sprintf("%s\n%s\n%s %s\n%s", xbits, ybits, strings.Repeat("-", (size*2)-(size*2/10)), operatorStringMap[op], fmt.Sprintf(formatter, result)) @@ -229,6 +229,6 @@ func explainBitwise(transform *Transform, xValue, yValue string, op token.Token) result = int64(fx) >> int64(fy) } - transform.Explaination = fmt.Sprintf("%s %s-shifted by %d = %s", + transform.Explanation = fmt.Sprintf("%s %s-shifted by %d = %s", xbits, shiftDirection, int64(fy), fmt.Sprintf(formatter, result)) } diff --git a/exp/explain/visitor_test.go b/exp/explain/visitor_test.go index 794a1d2..bdd4b03 100644 --- a/exp/explain/visitor_test.go +++ b/exp/explain/visitor_test.go @@ -158,9 +158,9 @@ func TestVisit(t *testing.T) { transforms := v.Value() - // Ignore Explaination + // Ignore Explanation for i := range transforms { - transforms[i].Explaination = "" + transforms[i].Explanation = "" } if diff := cmp.Diff(transforms, tc.transforms); diff != "" {