File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
59
59
{
60
60
Pos : assignStmt .Pos (),
61
61
End : assignStmt .End (),
62
- NewText : [] byte ( suggested ) ,
62
+ NewText : suggested ,
63
63
},
64
64
},
65
65
})
@@ -215,10 +215,10 @@ func getRootIdent(pass *analysis.Pass, node ast.Node) *ast.Ident {
215
215
}
216
216
217
217
// render returns the pretty-print of the given node
218
- func render (fset * token.FileSet , x interface {}) (string , error ) {
218
+ func render (fset * token.FileSet , x interface {}) ([] byte , error ) {
219
219
var buf bytes.Buffer
220
220
if err := printer .Fprint (& buf , fset , x ); err != nil {
221
- return "" , fmt .Errorf ("printing node: %w" , err )
221
+ return nil , fmt .Errorf ("printing node: %w" , err )
222
222
}
223
- return buf .String (), nil
223
+ return buf .Bytes (), nil
224
224
}
You can’t perform that action at this time.
0 commit comments