In Go language, atomic packages supply lower level atomic memory that is helpful is implementing synchronization algorithms. The LoadUint64() function in Go language is used to atomically load *addr. This function is defined under the atomic package. Here, you need to import “sync/atomic” package in order to use these functions.
func LoadUint64(addr *uint64) (val uint64)
Here, addr indicates address.
Note: (*uint64) is the pointer to a uint64 value. However, uint64 contains the set of all unsigned 64-bit integers from 0 to 18446744073709551615.
Return value: It returns the value loaded to the *addr.
587786787 9 78678844556666 3446
1068 // A random value is returned in each run
In the above example, the new values are returned from AddUint64() method in each call until the loop stops, LoadUint64() method loads these new uint64 values. And these values are stored in different addresses which can be random one so, the output of the LoadUint32() method here in each run is different. So, here a random value is returned in the output.