MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / Clone

Method Clone

projects/Go/proto/protoex/Order.go:89–98  ·  view source on GitHub ↗

Struct deep clone

()

Source from the content-addressed store, hash-verified

87
88// Struct deep clone
89func (s *Order) Clone() *Order {
90 // Serialize the struct to the FBE stream
91 writer := NewOrderModel(fbe.NewEmptyBuffer())
92 _, _ = writer.Serialize(s)
93
94 // Deserialize the struct from the FBE stream
95 reader := NewOrderModel(writer.Buffer())
96 result, _, _ := reader.Deserialize()
97 return result
98}
99
100// Get the struct key
101func (s *Order) Key() OrderKey {

Callers

nothing calls this directly

Calls 4

SerializeMethod · 0.95
BufferMethod · 0.95
DeserializeMethod · 0.95
NewOrderModelFunction · 0.70

Tested by

no test coverage detected