go-steam icon indicating copy to clipboard operation
go-steam copied to clipboard

Pointer receiver for named map type.

Open bbqtd opened this issue 8 years ago • 0 comments

https://github.com/Philipp15b/go-steam/blob/master/economy/inventory/inventory_apps.go#L13-L15

Regarding spec, map and slice is reference types, so why go-steam use pointer receiver for named map type? It looks like overusing pointer without reason.

And I can't find of case for using this function.

So, my proposal is use value receiver for reference type in most cases because we don't change reference, we change data at reference. For example in go stdlib ip.go What do you think about it?

bbqtd avatar Jul 12 '16 16:07 bbqtd