-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package defines -update flag even if golden package is unused #270
Comments
Thank you for the bug report! I have been wondering if this flag would conflict at some point. The reasons it's imported from I imagine you might be using I've got an idea for how to fix this using https://pkg.go.dev/flag#Lookup. Let me open a PR to see how it works. |
I've opened #271. I tried it out , and it works as long as Let me know if this works for you. |
Great, thanks! I'll take a look at getting |
With both packages patched everything works great. In my case autogold is imported second so #271 isn't actually being used yet, but it's good not to rely on import order. |
We use
gotest.tools/v3/assert
right now and I'm happy with it.I'd like to use
github.com/hexops/autogold
to automatically update tests with inline values, but if I try to use it andgotest.tools/v3/assert
in the same package, initialization panics withflag redefined: update
and tests don't run.I'd understand that the problem might be impossible to fix if I were using both
gotest.tools/v3/golden
andautogold
, but it feels like it should be possible to usegotest.tools/v3/assert
andautogold
together.Would you be interested in a PR to fix this? Maybe the internal packages can be rearranged to only define the flag when
golden
is used.The text was updated successfully, but these errors were encountered: