-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(spanner): SelectAll struct fields match should be case-insensitive #9417
Conversation
@@ -2087,8 +2088,8 @@ func TestSelectAll(t *testing.T) { | |||
}, | |||
}, | |||
want: &[]testStruct{ | |||
{Col1: 1, Col2: 1.1, Col3: "value", Col4: tm}, | |||
{Col1: 2, Col2: 2.2, Col3: "value2", Col4: tm.Add(24 * time.Hour)}, | |||
{Col1: 1, COL2: 1.1, Col3: "value", Col4: tm}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here also: Should this not be kept as Col2
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this should be COL2
, because testStruct is user defined struct and we are asserting that though mock response contained col2
it was successfully decoded in testStruct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, yeah, I read that wrong. I thought that this was also a mock iterator, but it's clearly not....
Fixes: #9415
row.ToStruct does case-insensitive match against the Go struct field names using https://pkg.go.dev/cloud.googles.ltd/go/internal/fields#List.Match, others decode methods should also follow the same