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

chore(spanner): regenerate proto files and fix tests #10242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion spanner/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,16 @@ func TestIntegration_BasicTypes_ProtoColumns(t *testing.T) {
if want == nil {
want = test.val
}
gotp := reflect.New(reflect.TypeOf(want))

var gotp reflect.Value
switch want.(type) {
case proto.Message:
// We are passing a pointer of proto message in `want` due to `go vet` issue.
// Through the switch case, we are dereferencing the value so that we get proto message instead of its pointer.
gotp = reflect.New(reflect.TypeOf(want).Elem())
default:
gotp = reflect.New(reflect.TypeOf(want))
}
v := gotp.Interface()

switch nullValue := v.(type) {
Expand Down
Binary file modified spanner/testdata/protos/descriptors.pb
Binary file not shown.
85 changes: 40 additions & 45 deletions spanner/testdata/protos/singer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions spanner/testdata/protos/singer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

syntax = "proto2";
syntax = "proto3";

package examples.spanner.music;
option go_package = "./";
option go_package = "protos/";

message SingerInfo {
optional int64 singer_id = 1;
Expand Down
Loading