Should you use slices of pointers to structs? (www.willem.dev)
from nebiros@programming.dev to golang@programming.dev on 21 Aug 2023 13:56
https://programming.dev/post/1963774

While writing Go, you might might run into the following situation: You want to collect the results of a function in a slice. However, the function returns a pointer.

You might then ask yourself:

What kind of slice should I use? A slice of values or a slice of pointers?

Let’s make this a bit more concrete.

#golang

threaded - newest