Re: [go-nuts] cgo and dynamic linking of shared labraries

2023-09-25 Thread Ian Lance Taylor
On Sat, Sep 23, 2023 at 6:38 AM sbezverk wrote: > > Since I could not find the answer in the cgo documentation, I would really > appreciate if somebody could help me to understand why when I build cgo code > with calls to the shared library, the linker tries to find the shared library > even

Re: [go-nuts] Golang+CGO using ucontext crash(on purpose) with SIGSEGV or SIGTRAP while using different stacks

2023-09-25 Thread Ian Lance Taylor
On Sat, Sep 23, 2023 at 10:32 PM zk Z wrote: > > I'm currently writing a Golang + CGO program, and will use posix ucontext in > CGO. Since all my core logic will be in the bind function of ucontext, we > should catch up all the bad code. And I test it by accessing to the null > pointer, which

[go-nuts] Re: [ANN] GraphBLAS binding for Go

2023-09-25 Thread Corin Lawson
Fantastic work! I'm no authority on the subject of Go programming style but the CheckErrors and OK pattern seems very unusual. Can you tell me the reasons for that design choice? On Tuesday, 19 September 2023 at 10:13:54 pm UTC+10 Pascal Costanza wrote: > Hi, > > > I am happy to announce a

Re: [go-nuts] Help understanding slices, variable arguments, and passing slices to functions

2023-09-25 Thread Jan Mercl
On Mon, Sep 25, 2023 at 1:57 PM Andrew Pillar wrote: A nice discussion of slices can be found for example here: https://research.swtch.com/godata tl;dr: Yes, slices are passed by value (everything in Go is passed by value), but a slice does not contain the backing array, only a pointer to it.

[go-nuts] Help understanding slices, variable arguments, and passing slices to functions

2023-09-25 Thread Andrew Pillar
I have some code whereby I am iterating over some data, putting that data into a buffer slice defined outside the loop, then passing the contents of that buffer slice to a function which returns a struct containing that data. See the playground link as a stripped down demonstration of what I'm