Hi! In my day-to-day life as a software engineer, I try to find time to discover new things in the world of computer science. I want to share these discoveries on this blog because it helps me stay on track, and maybe even collaborate with others in this field!
To make it easier to understand, think of it like a car: the key you use to drive is your pointer, and the car is the value. The key is not the car itself, but it allows you to access it. Similarly, a pointer is not the data, but it allows you to access the data in memory.
Let's look at a case where using pointers is not necessary. If you don't need to modify the Car object but only read or process data without altering the original state, there's no need to pass a pointer.
in general, pointers are often used when the data size is large, but if you're only changing a primitive type, it's not worth using them.
This is just a small article on pointers in Go. I didn't cover other commonly used data structures, like slices, to avoid making it too heavy. If there's interest, I’ll add a section on slices. I hope you enjoyed it!