Philipp15b / go-steam

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.
https://pkg.go.dev/github.com/Philipp15b/go-steam/v3
Other
392 stars 132 forks source link

Pointer receiver for named map type. #82

Open bbqtd opened 8 years ago

bbqtd commented 8 years ago

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?