Pointers to arrays in golang

1. How to represent the pointer to the array in golang?
2. How to pass a pointer to an array in a function?

I don"t quite understand the pointers to arrays in golang. Any great god will use a case to analyze the above two problems.
No good answers have been found on the Internet (are there fewer pointers to arrays)?

Mar.09,2021

is right. In general, you don't have to pass pointers to map and slice to save memory overhead, but in some unmarshal scenarios you will use their pointers


map and slice are "pointers" (or "references").


  1. Array pointer indicates
 

array is a value type in go, but is simply a collection of elements of a single type of the underlying type int, float, bool, or string. There are two ways to use array pointers:
1. Use slice
2. As a normal value type, use & to get the address

pointer array passes parameters in the same way.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb212b-23a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb212b-23a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?