Skip to content

Commit bc26b3f

Browse files
echistyakovfacebook-github-bot
authored andcommitted
Unbreak tests
Summary: Unbreak tests. Reviewed By: podtserkovskiy Differential Revision: D71194918 fbshipit-source-id: 3f8a03c490e973adcf07a5617d1f5d4bf241e2a0
1 parent 7546273 commit bc26b3f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

third-party/thrift/src/thrift/conformance/go/conformance_server.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ func newResponse(request *thrift_any.Any, data []byte) *thrift_any.Any {
206206
func serialize(obj thrift.Struct, protoc *protocol.ProtocolStruct) ([]byte, error) {
207207
switch protoc.GetStandard() {
208208
case protocol.StandardProtocol_Custom:
209+
return thrift.EncodeCompact(obj)
209210
case protocol.StandardProtocol_Binary:
210211
return thrift.EncodeBinary(obj)
211212
case protocol.StandardProtocol_Compact:
@@ -214,9 +215,10 @@ func serialize(obj thrift.Struct, protoc *protocol.ProtocolStruct) ([]byte, erro
214215
return thrift.EncodeCompactJSON(obj)
215216
case protocol.StandardProtocol_SimpleJson:
216217
return thrift.EncodeSimpleJSON(obj)
218+
default:
219+
// default value in case the protocol is unknown, as seen in the java implementation of conformance tests.
220+
return thrift.EncodeCompact(obj)
217221
}
218-
// default value in case the protocol is unknown, as seen in the java implementation of conformance tests.
219-
return thrift.EncodeCompact(obj)
220222
}
221223

222224
// loadStruct loads a thrift.Struct from the typeRegistry for a given thrift.Any.
@@ -255,6 +257,7 @@ func deserialize(registry *typeRegistry, value *thrift_any.Any) (thrift.Struct,
255257
protoc := getProtocol(value)
256258
switch protoc.GetStandard() {
257259
case protocol.StandardProtocol_Custom:
260+
err = thrift.DecodeCompact(value.GetData(), obj)
258261
case protocol.StandardProtocol_Binary:
259262
err = thrift.DecodeBinary(value.GetData(), obj)
260263
case protocol.StandardProtocol_Compact:

0 commit comments

Comments
 (0)