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
The above doesn't work, the buffer remains empty. It can be fixed by passing o as a pointer:
write(buf, &o)
fmt.Println(buf.Bytes())
Now, the weird thing is: if the example struct is once unpacked before the packing, it works regardless of whether the struct is passed by value or by pointer.
This is not specific to the instance of the struct but a global effect. As long as the unpacking happened once in the running task, packing works fine.
Can anyone make sense of that? I'm not even sure if this is a bug.
The text was updated successfully, but these errors were encountered:
I've bumped into this weird issue and I still can't make sense of it.
Consider the following example:
The above doesn't work, the buffer remains empty. It can be fixed by passing
o
as a pointer:Now, the weird thing is: if the example struct is once unpacked before the packing, it works regardless of whether the struct is passed by value or by pointer.
This is not specific to the instance of the struct but a global effect. As long as the unpacking happened once in the running task, packing works fine.
Can anyone make sense of that? I'm not even sure if this is a bug.
The text was updated successfully, but these errors were encountered: