3 ms·
I didn't know the answer, but I just did a bit of Googling to determine that one of the reasons that pass-by-value can be preferred is because it makes life eas
by robzyb 9y ago
I didn't know the answer, but I just did a bit of Googling to determine that one of the reasons that pass-by-value can be preferred is because it makes life easier for the garbage collector.
See golang escape analysis: http://www.agardner.me/golang/garbage/collection/gc/escape/analysis/2015/10/18/go-escape-analysis.html http://www.agardner.me/golang/garbage/collection/gc/escape/a...