4 ms·
If it was pointers in general I would have expected the article to talk about pointer arithmetic, which from other comments in the thread seem to be not possibl
by my_ghola 9y ago
If it was pointers in general I would have expected the article to talk about pointer arithmetic, which from other comments in the thread seem to be not possible in Go.
What is the use case for pointers then? are parameters passed by value instead of by reference by default?
- pjmlp 9y agoPointer arithmetic is possible in Go via the unsafe package. Here is an example. buff := (*[25][80][2]byte)(unsafe.Pointer(uintptr(addr) + 25))