gotest.tools
gotest.tools copied to clipboard
Feature request: Add a flag for updating golden files interactively
It would be nice if there was a way to run the tests, and for each one that fails, prompt the user to decide whether to update the diff or not. Think a UX similar to git add -p
I like it! Maybe something like -update={ask,prompt,interactive}. Use the same flag, the value is still optional.
I looked into this a bit, and it sounds like unfortunately it is not possible. See https://echorand.me/posts/go-test-stdin/.
Go tests are run with os.Stdin set to /dev/null, so there's no input stream that can be used to prompt for input.