Skip to content

Conversation

@patrickpichler
Copy link
Contributor

If a struct has a byte array/slice field and it happens to be the zero value, a dynamic list object was returned. This caused issues with functions taking Bytes via arguments, as the type checker will accept such functions, but they might fail at runtime.

To work around this, the raw bytes array/slice is returned in case of an zero value.

…of dynamic list

If a struct has a byte array/slice field and it happens to be the zero
value, a dynamic list object was returned. This caused issues with
functions taking `Bytes` via arguments, as the type checker will accept
such functions, but they might fail at runtime.

To work around this, the raw bytes array/slice is returned in case of an
zero value.
@TristonianJones
Copy link
Collaborator

/gcbrun

@patrickpichler patrickpichler force-pushed the fix/zero-values-bytes branch from 9e63be1 to f7b02bd Compare July 23, 2024 08:28
@TristonianJones
Copy link
Collaborator

/gcbrun

Copy link
Collaborator

@TristonianJones TristonianJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit, but otherwise LGTM

For most types, it is good enough to use the raw interface values for
null types. Hence the logic of getFieldValue has been adjusted to remove
some special handling code.
@TristonianJones
Copy link
Collaborator

/gcbrun

@TristonianJones TristonianJones merged commit 1f51886 into google:master Jul 31, 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

Successfully merging this pull request may close these issues.

2 participants