There is a runtime.SetFinalizer function.
On Sunday, November 22, 2020 at 8:13:22 PM UTC+8 Sean wrote:
> I am writing a Golang wrapper for OpenAL-Soft.
> I need to create some buffers. These operations are happening on the
> OpenAL-Soft side (So C functions). I am loading PCM data into buffers.
Thanks a lot for the help! Seems like I could sort it out based on the
reflect.DeepEqual code. Do you have any testing tips?
Out of general curiosity, I am wondering why the type is part of the key
for the visited map here: https://golang.org/src/reflect/deepequal.go#L15.
If I remove it, the te
Read about Go finalizers.
> On Nov 22, 2020, at 6:13 AM, Sean wrote:
>
> I am writing a Golang wrapper for OpenAL-Soft.
> I need to create some buffers. These operations are happening on the
> OpenAL-Soft side (So C functions). I am loading PCM data into buffers.
>
> Can I set up a trigger m
I am writing a Golang wrapper for OpenAL-Soft.
I need to create some buffers. These operations are happening on the
OpenAL-Soft side (So C functions). I am loading PCM data into buffers.
Can I set up a trigger mechanism like "x.__del__" as in Python?
I can set the garbage collector to follow s
Thank you Aleksey. That is indeed a working solution, and it works well.
Here are the two functions I wrote as suggested:
func bool2int(b bool) int {
if b {
return 1
}
return 0
}
func testBitHack(v int) bool {
return (bool2int(v==10) & bool2int(v==