Atlas › Test
TestEncode
Exact test identity: go.temporal.io/server/common/codec/TestJSONPBEncoderSuite/TestEncode
- Package
go.temporal.io/server/common/codec
- Suite / test hierarchy
TestJSONPBEncoderSuite/TestEncode
- Test
TestEncode
- Introduced at
- TestEncode Frontier kind: Test frontier
- Covered ranges
- 2
- Covered lines
- 6
- Covered files
- 1
Covered source
Expand a file to inspect source; the > gutter marks covered lines.
go.temporal.io/server/common/codec/jsonpb.go 6 covered LOC · 2 ranges
Open complete file
23
24
// NewJSONPBEncoder creates a new JSONPBEncoder.
25
>
func NewJSONPBEncoder() JSONPBEncoder {
jsonpb.go
26
>
return JSONPBEncoder{}
27
>
}
28
29
// NewJSONPBIndentEncoder creates a new JSONPBEncoder with indent.
37
38
// Encode protobuf struct to bytes.
39
>
func (e JSONPBEncoder) Encode(pb proto.Message) ([]byte, error) {
jsonpb.go
40
>
return e.marshaler.Marshal(pb)
41
>
}
42
43
// Decode bytes to protobuf struct.