Describe the bug
The time-equal rule passes an ast.Expr to a %s placeholder in its message format, but not all ast.Expr implement String(), so junk is output for certain kinds of expressions (such as comparing a time.Time that's returned from a function call).
To Reproduce
Steps to reproduce the behavior:
I updated revive go install github.com/mgechev/revive@latest
I run it with the following flags & configuration file:
Describe the bug The
time-equal
rule passes anast.Expr
to a%s
placeholder in its message format, but not allast.Expr
implementString()
, so junk is output for certain kinds of expressions (such as comparing atime.Time
that's returned from a function call).To Reproduce Steps to reproduce the behavior:
go install github.com/mgechev/revive@latest
Source file
time-equal-test.go
:Expected behavior Something more readable than: