-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Panic in assert/require.Equal when calling into go-spew #480
Comments
Hello @akalin . This is not a testify bug. In go lower case fields (labels in general) are not visible outside the defining package, reflect is outside. So you have to upper your f field to "F" You can read this for more informations : https://blog.golang.org/laws-of-reflection |
go-spew, which testify uses, explicitly handles unexported fields; see https://github.com/davecgh/go-spew. So you're probably right in that the bug doesn't lie with testify directly. Perhaps it needs to revendor go-spew to a new version, or perhaps the bug is still in go-spew's tip. In any case, testify panicking definitely seems like a bug to me, especially if |
I'm seeing the same behavior. This is a bug in testify, whether it's caused by testify code or indirectly by the dependency on spew. I've filed an issue with spew, since I can reproduce it independent of testify's usage: |
Got the same problem here, this is definitely a spew issue (or bad spew version dependency here) only happening when the structs differ. |
I note that spew has not seen a commit to its default branch for 4 years. It seems to be effectively unmaintained. I'm not sure what the best fix is here. It might make sense to borg the code into testify or to fork it and maintain that fork. |
Minimal test case:
running
go test .
produces:The text was updated successfully, but these errors were encountered: