@@ -101,11 +101,11 @@ func (s *Shortener) Shorten(contents []byte) ([]byte, error) {
101
101
// Do initial, non-line-length-aware formatting
102
102
contents , err = s .formatSrc (contents )
103
103
if err != nil {
104
- return nil , fmt .Errorf ("Error formatting source: %+v" , err )
104
+ return nil , fmt .Errorf ("error formatting source: %+v" , err )
105
105
}
106
106
107
107
for {
108
- log .Debugf ("Starting round %d" , round )
108
+ log .Debugf ("starting round %d" , round )
109
109
110
110
// Annotate all long lines
111
111
lines := strings .Split (string (contents ), "\n " )
@@ -125,7 +125,7 @@ func (s *Shortener) Shorten(contents []byte) ([]byte, error) {
125
125
}
126
126
127
127
if stop {
128
- log .Debug ("Nothing more to shorten or reformat, stopping" )
128
+ log .Debug ("nothing more to shorten or reformat, stopping" )
129
129
break
130
130
}
131
131
@@ -144,7 +144,7 @@ func (s *Shortener) Shorten(contents []byte) ([]byte, error) {
144
144
}
145
145
defer dotFile .Close ()
146
146
147
- log .Debugf ("Writing dot file output to %s" , s .config .DotFile )
147
+ log .Debugf ("writing dot file output to %s" , s .config .DotFile )
148
148
err = CreateDot (result , dotFile )
149
149
if err != nil {
150
150
return nil , err
@@ -160,14 +160,14 @@ func (s *Shortener) Shorten(contents []byte) ([]byte, error) {
160
160
output := bytes .NewBuffer ([]byte {})
161
161
err = decorator .Fprint (output , result )
162
162
if err != nil {
163
- return nil , fmt .Errorf ("Error parsing source: %+v" , err )
163
+ return nil , fmt .Errorf ("error parsing source: %+v" , err )
164
164
}
165
165
contents = output .Bytes ()
166
166
167
167
round ++
168
168
169
169
if round > maxRounds {
170
- log .Debugf ("Hit max rounds, stopping" )
170
+ log .Debugf ("hit max rounds, stopping" )
171
171
break
172
172
}
173
173
}
@@ -182,7 +182,7 @@ func (s *Shortener) Shorten(contents []byte) ([]byte, error) {
182
182
// Do final round of non-line-length-aware formatting after we've fixed up the comments
183
183
contents , err = s .formatSrc (contents )
184
184
if err != nil {
185
- return nil , fmt .Errorf ("Error formatting source: %+v" , err )
185
+ return nil , fmt .Errorf ("error formatting source: %+v" , err )
186
186
}
187
187
188
188
return contents , nil
@@ -357,20 +357,20 @@ func (s *Shortener) isGoDirective(line string) bool {
357
357
func (s * Shortener ) formatNode (node dst.Node ) {
358
358
switch n := node .(type ) {
359
359
case dst.Decl :
360
- log .Debugf ("Processing declaration: %+v" , n )
360
+ log .Debugf ("processing declaration: %+v" , n )
361
361
s .formatDecl (n )
362
362
case dst.Expr :
363
- log .Debugf ("Processing expression: %+v" , n )
363
+ log .Debugf ("processing expression: %+v" , n )
364
364
s .formatExpr (n , false , false )
365
365
case dst.Stmt :
366
- log .Debugf ("Processing statement: %+v" , n )
366
+ log .Debugf ("processing statement: %+v" , n )
367
367
s .formatStmt (n )
368
368
case dst.Spec :
369
- log .Debugf ("Processing spec: %+v" , n )
369
+ log .Debugf ("processing spec: %+v" , n )
370
370
s .formatSpec (n , false )
371
371
default :
372
372
log .Debugf (
373
- "Got a node type that can't be shortened: %+v" ,
373
+ "got a node type that can't be shortened: %+v" ,
374
374
reflect .TypeOf (n ),
375
375
)
376
376
}
@@ -393,7 +393,7 @@ func (s *Shortener) formatDecl(decl dst.Decl) {
393
393
}
394
394
default :
395
395
log .Debugf (
396
- "Got a declaration type that can't be shortened: %+v" ,
396
+ "got a declaration type that can't be shortened: %+v" ,
397
397
reflect .TypeOf (d ),
398
398
)
399
399
}
@@ -473,7 +473,7 @@ func (s *Shortener) formatStmt(stmt dst.Stmt) {
473
473
default :
474
474
if shouldShorten {
475
475
log .Debugf (
476
- "Got a statement type that can't be shortened: %+v" ,
476
+ "got a statement type that can't be shortened: %+v" ,
477
477
reflect .TypeOf (st ),
478
478
)
479
479
}
@@ -565,7 +565,7 @@ func (s *Shortener) formatExpr(expr dst.Expr, force bool, isChain bool) {
565
565
default :
566
566
if shouldShorten {
567
567
log .Debugf (
568
- "Got an expression type that can't be shortened: %+v" ,
568
+ "got an expression type that can't be shortened: %+v" ,
569
569
reflect .TypeOf (e ),
570
570
)
571
571
}
@@ -585,7 +585,7 @@ func (s *Shortener) formatSpec(spec dst.Spec, force bool) {
585
585
default :
586
586
if shouldShorten {
587
587
log .Debugf (
588
- "Got a spec type that can't be shortened: %+v" ,
588
+ "got a spec type that can't be shortened: %+v" ,
589
589
reflect .TypeOf (sp ),
590
590
)
591
591
}
0 commit comments