We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b78d69c commit 717ac65Copy full SHA for 717ac65
nvim/api_tool.go
@@ -12,7 +12,6 @@ import (
12
"go/ast"
13
"go/format"
14
"go/parser"
15
- "go/printer"
16
"go/token"
17
"io/ioutil"
18
"log"
@@ -96,8 +95,8 @@ var extensionTypes = map[string]ExtensionType{
96
95
}
97
98
func formatNode(fset *token.FileSet, node interface{}) string {
99
- var buf bytes.Buffer
100
- if err := printer.Fprint(&buf, fset, node); err != nil {
+ var buf strings.Builder
+ if err := format.Node(&buf, fset, node); err != nil {
101
panic(err)
102
103
return buf.String()
0 commit comments