gotest.tools icon indicating copy to clipboard operation
gotest.tools copied to clipboard

Feature request: Add a flag for updating golden files interactively

Open andremarianiello opened this issue 3 years ago • 2 comments

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

andremarianiello avatar Oct 20 '22 20:10 andremarianiello

I like it! Maybe something like -update={ask,prompt,interactive}. Use the same flag, the value is still optional.

dnephin avatar Oct 21 '22 01:10 dnephin

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.

dnephin avatar Dec 09 '23 21:12 dnephin