3 ms·
So... you have the right idea, but your statement about passing is technically wrong. Everything in Go is passed by copying its value. However, slices, maps,
by NateDad 13y ago
So... you have the right idea, but your statement about passing is technically wrong.
Everything in Go is passed by copying its value.
However, slices, maps, channels, and interfaces all have small values, which are just a pointer and some other small data (length, type, etc), so passing them directly (rather than by pointer) is not a big deal.
- deleted 13y ago[deleted]