mirror of
https://github.com/mgechev/revive.git
synced 2025-03-21 21:17:06 +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)
|
return oper.Name, (oper.Name == trueName || oper.Name == falseName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// gofmt returns a string representation of the expression.
|
// gofmt returns a string representation of an AST subtree.
|
||||||
func gofmt(x ast.Expr) string {
|
func gofmt(x interface{}) string {
|
||||||
buf := bytes.Buffer{}
|
buf := bytes.Buffer{}
|
||||||
fs := token.NewFileSet()
|
fs := token.NewFileSet()
|
||||||
printer.Fprint(&buf, fs, x)
|
printer.Fprint(&buf, fs, x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user