cmd/qtify
I’d love a source code rewriter that ports existing tests to quicktest. Could start with just the low-hanging fruit, the obvious cases. Bonus for also rewriting from testify. :)
With appropriate docs or a flag, it could even do slightly-semantic-changing things like err != nil to qt.IsNonNil.
Yes, I've been wanting to do this for ages!
I'd start with the testify rewrite because I think that's easier and because I'd like it to be easy to suggest that people migrate, and it's more of a clear win.
bikeshedding on the name: qtfix ? gofixqt ? (I quite like including "go" in Go-oriented commands FWIW).
(Disclaimer: I am the author of gotest.tools/v3/assert)
In case anyone is interested in a tool that does exactly this for a different assertion library gty-migrate-from-testify does this translation for gotest.tools/v3/assert.
It will rewrite all the common assertions directly, and print a line to stdout for any less-common assertion that could not be translated (which is generally a small number in my experience running the tool on large code bases).
As I mentioned in https://github.com/frankban/quicktest/issues/94#issuecomment-832114597, there are many similarities with these two libraries.
@dnephin very interesting, thanks for pointing us to that!
Damn, this would have saved me at least ten hours of work over the last year :) Happy to help test one such tool.