mirror of
https://github.com/mgechev/revive.git
synced 2025-03-17 20:57:58 +02:00
utils.gofmt now accepts a interface{}
This commit is contained in:
parent
000a70d12a
commit
579c7c761f
@ -182,8 +182,8 @@ func isExprABooleanLit(n ast.Node) (lexeme string, ok bool) {
|
||||
return oper.Name, (oper.Name == trueName || oper.Name == falseName)
|
||||
}
|
||||
|
||||
// gofmt returns a string representation of the expression.
|
||||
func gofmt(x ast.Expr) string {
|
||||
// gofmt returns a string representation of an AST subtree.
|
||||
func gofmt(x interface{}) string {
|
||||
buf := bytes.Buffer{}
|
||||
fs := token.NewFileSet()
|
||||
printer.Fprint(&buf, fs, x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user