Open Cylkal opened 3 years ago
hey @Cylkal - sorry I haven't been able to get to this sooner. I'll have to carve out some time to take a deeper look at it. For now, if it helps you get unstuck, you could implement the GomegaStringer
interface to control how your object's output is formatted and possibly avoid the panic?
hey @Cylkal - sorry I haven't been able to get to this sooner. I'll have to carve out some time to take a deeper look at it. For now, if it helps you get unstuck, you could implement the
GomegaStringer
interface to control how your object's output is formatted and possibly avoid the panic?
yeah, this may be one way.
go version go1.16.7 linux/amd64
when use matcher gomega.Equal it will use format.Message() to format actual and expected. When format a struct type, the call chain is as follows: Message -> Object -> formatValue ->formatStruct when format struct contains a field which is a cgo struct, it may be panic:
the cgo struct like:
where pcre_extra define:
use fmt, it print like:
and panic occurs when visit field
match_limit_recursion
by call reflect.Value.Uint().Could you avoid format cgo struct, or other method like add a new format methd not format unexported field?