Re:Making a Go program 70% faster with a one character change
by erik_seaberg on Monday November 14, 2022 @01:56PM
(#33599035)
Go maps and channels have reference semantics. Slices are passed and returned by value, but state may be shared (not copied) in an error-prone way, so it’s safest to pretend they have move semantics and treat only one copy as valid.
IMHO they should have used pointers everywhere they didn’t want value semantics.
IMHO they should have used pointers everywhere they didn’t want value semantics.