On Mon, May 27, 2019 at 2:18 AM Sergey Kamardin wrote:
>
> On Sun, 05/26/19, May 26, 2019 at 07:59:07PM -0400, Ian Lance Taylor wrote:
> > This is not valid. The rule is that SliceHeader is only valid when
> > inspecting an actual slice header. You have to write
> >
> > h.Data = uintptr(unsa
On Mon, 27 May 2019, 07:18 Sergey Kamardin, wrote:
> Hello Ian,
>
> Thank you for your answer.
>
> On Sun, 05/26/19, May 26, 2019 at 07:59:07PM -0400, Ian Lance Taylor wrote:
> > This is not valid. The rule is that SliceHeader is only valid when
> > inspecting an actual slice header. You have t
Hello Ian,
Thank you for your answer.
On Sun, 05/26/19, May 26, 2019 at 07:59:07PM -0400, Ian Lance Taylor wrote:
> This is not valid. The rule is that SliceHeader is only valid when
> inspecting an actual slice header. You have to write
>
> h.Data = uintptr(unsafe.Pointer(&b))
> h.Len
On Sun, May 26, 2019 at 11:30 AM Sergey Kamardin wrote:
>
> func ReadHeader(r io.Reader) (Header, error) {
> var (
> b [16]byte
> bts []byte
> )
> h := (*reflect.SliceHeader)(unsafe.Pointer(&b
On Sun, May 26, 2019 at 5:30 PM Sergey Kamardin wrote:
I'm not sure what the goal is, but the code looks like doing the same
as just `bts := b[:]`. But then it's equal to just `bts :=
make([]byte, 16)`. Remember, there si no stack nor heap wrt the
language specification, so there is no guaranteed