You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some question about the generator for go. Why use reader as decode input params insteadof []byte or bytes.buffer. For most secenes,
we need start routine for a receive message:this means we need get a business msg buffer, then parse it in other routine. so,why not use []byte or bytes.buffer as input param. Now:
buf := make([]byte,512)
n,err:= conn.Read()
go func() {
reader := bytes.NewReader(buf[:n])
xxx.Decode(reader,) // decode buf to sbe object
}
Actually:
xxx.Decode([]byte) // decode buf to sbe object
xxx.Decode(bytes.buffer) // this is ok