+
Skip to content

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

Open
@jvmakine

Description

@jvmakine

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)
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载