aboutsummaryrefslogtreecommitdiff
path: root/formatter/formatter.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-11 05:11:14 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-11 05:11:14 +0200
commitcbbbfedd615915c5ffc09fd644a787158d8ef866 (patch)
treec547a36dbd6d6ffd64b43cd8cf566aa351688c3c /formatter/formatter.go
parent8bbf31f9f779ae9958ff3324f0f7735aa366f7bc (diff)
Run ‘go fmt’
Diffstat (limited to 'formatter/formatter.go')
-rw-r--r--formatter/formatter.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/formatter/formatter.go b/formatter/formatter.go
index af84ec3..6249c0a 100644
--- a/formatter/formatter.go
+++ b/formatter/formatter.go
@@ -14,11 +14,11 @@ var (
'&': "&amp;",
'<': "&lt;",
}
- stringEscapes = map[rune]string {
- '"': "&quot;",
- '&': "&amp;",
- '<': "&lt;",
- '>': "&gt;",
+ stringEscapes = map[rune]string{
+ '"': "&quot;",
+ '&': "&amp;",
+ '<': "&lt;",
+ '>': "&gt;",
'\'': "&apos;",
}
)
@@ -49,10 +49,10 @@ func PrintAst(ast parser.AstNode) {
func printAttrs(attrs []parser.Attr) {
classes := attrs
- classes = slices.DeleteFunc(classes, func (a parser.Attr) bool {
+ classes = slices.DeleteFunc(classes, func(a parser.Attr) bool {
return a.Key != "class"
})
- attrs = slices.DeleteFunc(attrs, func (a parser.Attr) bool {
+ attrs = slices.DeleteFunc(attrs, func(a parser.Attr) bool {
return a.Key == "class"
})
@@ -60,7 +60,7 @@ func printAttrs(attrs []parser.Attr) {
fmt.Print(" class=\"")
for i, a := range classes {
fmt.Print(a.Value)
- if i != len(classes) - 1 {
+ if i != len(classes)-1 {
fmt.Print(" ")
} else {
fmt.Print("\"")
@@ -105,7 +105,7 @@ func printChildrenTrim(nodes []parser.AstNode) {
if i == 0 && n.Type == parser.Text {
n.Text = trimLeftSpaces(n.Text)
}
- if i == len(nodes) - 1 && n.Type == parser.Text {
+ if i == len(nodes)-1 && n.Type == parser.Text {
n.Text = trimRightSpaces(n.Text)
}