From 579c7c761fe9ca9c80141b95ad717525224c40e3 Mon Sep 17 00:00:00 2001 From: chavacava Date: Fri, 8 May 2020 17:52:30 +0200 Subject: [PATCH] utils.gofmt now accepts a interface{} --- rule/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/utils.go b/rule/utils.go index 6ba542b..38677c8 100644 --- a/rule/utils.go +++ b/rule/utils.go @@ -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)