diff options
author | Nick White <git@njw.name> | 2021-07-23 16:17:40 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-07-23 16:17:40 +0100 |
commit | b571f780dcc4baafa659bebbc316204a46e42f4f (patch) | |
tree | b892958a63fd95b63b5f0e3591fabb53a272a537 /cmd/dehyphenate/main.go | |
parent | 80a68210b4332e2d83e6b3e48a9ac94218d59f8b (diff) |
gofmt
Diffstat (limited to 'cmd/dehyphenate/main.go')
-rw-r--r-- | cmd/dehyphenate/main.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/dehyphenate/main.go b/cmd/dehyphenate/main.go index 0974368..284fc1a 100644 --- a/cmd/dehyphenate/main.go +++ b/cmd/dehyphenate/main.go @@ -34,7 +34,7 @@ func dehyphenateString(in string) string { words := strings.Split(line, " ") last := words[len(words)-1] // the - 2 here is to account for a trailing newline and counting from zero - if len(last) > 0 && last[len(last) - 1] == '-' && i < len(lines) - 2 { + if len(last) > 0 && last[len(last)-1] == '-' && i < len(lines)-2 { nextwords := strings.Split(lines[i+1], " ") if len(nextwords) > 0 { line = line[0:len(line)-1] + nextwords[0] @@ -80,7 +80,7 @@ func main() { for i, l := range h.Lines { w := l.Words[len(l.Words)-1] if len(w.Chars) == 0 { - if len(w.Text) > 0 && w.Text[len(w.Text) - 1] == '-' { + if len(w.Text) > 0 && w.Text[len(w.Text)-1] == '-' { h.Lines[i].Words[len(l.Words)-1].Text = w.Text[0:len(w.Text)-1] + h.Lines[i+1].Words[0].Text h.Lines[i+1].Words[0].Text = "" } |