We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f42e56 commit 951deddCopy full SHA for 951dedd
format_composite_literals.go
@@ -5,6 +5,7 @@ func formatCompositeLiterals(input []rune) []rune {
5
inStringLiteral, inRawStringLiteral bool
6
depth int
7
breakFields bool
8
+ lineWidth int
9
result []rune
10
)
11
for i, r := range input {
@@ -23,6 +24,9 @@ func formatCompositeLiterals(input []rune) []rune {
23
24
}
25
if r == '\n' {
26
depth = 0
27
+ lineWidth = 0
28
+ } else {
29
+ lineWidth++
30
31
result = append(result, r)
32
default:
@@ -38,6 +42,12 @@ func formatCompositeLiterals(input []rune) []rune {
38
42
39
43
40
44
45
46
47
48
+ }
49
+ if lineWidth >= 50 {
50
+ breakFields = true
41
51
52
if r == ',' && breakFields {
53
0 commit comments