From 9c93f03eb9d04ebafcf86f542865d24c6c877134 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 10 Sep 2023 22:34:07 +0200 Subject: Fix a panic --- formatter/formatter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formatter/formatter.go b/formatter/formatter.go index 25ecafc..7c80b96 100644 --- a/formatter/formatter.go +++ b/formatter/formatter.go @@ -111,8 +111,8 @@ func trimLeftSpaces(s string) string { } func trimRightSpaces(s string) string { - i := len(s) - 1 rs := []rune(s) + i := len(rs) - 1 for i >= 0 && unicode.IsSpace(rs[i]) { i-- } -- cgit v1.2.3