Skip to content
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

Infinite loop when calling assert.NotZero on a protoc-gen-go generated struct #28

Open
jvmakine opened this issue Oct 29, 2024 · 0 comments

Comments

@jvmakine
Copy link

jvmakine commented Oct 29, 2024

This only happens if msg.String() has been called on the generated message

Using "github.com/alecthomas/assert/v2"

If proto.Resource is a struct generated from a proto file with protoc-gen-go

This never finishes

t.Run("protoc message is not zero", func(t *testing.T) {
    res := &proto.Resource{}
    _ = res.String()
    assert.NotZero(t, res)
})

While this works correctly

t.Run("protoc message is not zero", func(t *testing.T) {
    res := &proto.Resource{}
    assert.NotZero(t, res)
})
@alecthomas alecthomas transferred this issue from alecthomas/assert Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant