[PD1] Fixed stuff. Unmarshal still returns map[string]interface{}, need to fix
This commit is contained in:
parent
c131aa2aea
commit
39a0e5c01f
6 changed files with 127 additions and 96 deletions
|
@ -26,12 +26,10 @@ func (c Connection[T]) Send(obj T) {
|
|||
}
|
||||
}
|
||||
|
||||
func (c Connection[T]) Receive() T {
|
||||
var obj T
|
||||
if err := c.decoder.Decode(&obj); err != nil {
|
||||
func (c Connection[T]) Receive(objPtr *T) {
|
||||
if err := c.decoder.Decode(objPtr); err != nil {
|
||||
panic("Failed decoding data or reading it from connection")
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
func (c Connection[T]) GetPeerCertificate() *x509.Certificate {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue