aboutsummaryrefslogtreecommitdiff
path: root/formatter/formatter.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-10 22:34:07 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-10 22:34:07 +0200
commit9c93f03eb9d04ebafcf86f542865d24c6c877134 (patch)
tree0aa3bbd2ff3adc266277b4f1034c64c9024808df /formatter/formatter.go
parent6a1cfc69868bdbdee67af26229cdf1a32c0ad7ec (diff)
Fix a panic
Diffstat (limited to 'formatter/formatter.go')
-rw-r--r--formatter/formatter.go2
1 files changed, 1 insertions, 1 deletions
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--
}