I think after a while people tend to come up with their own best practices
when using Go. Each person has their own preference. There is really no
right or wrong here. The argument for method vs function usually comes down
to the domain and which makes more sense.
For my own 'rules', I prefer
I am really happy with thoughts and points shared so far, thank you all!
Unfortunately I am not able to edit original my post, so to make sure I got
all of these points I will just sum up everything below, I think this
summary may be valuable for any less experienced gopher, please correct me
A short way to see it for me is to reason in terms of capabilities.
What is an instance of a given type supposed to be able to do? (method)
versus what am I able to do with or upon a given instance (function).
It's not always clear though but it can help.
On Thursday, June 2, 2022 at 4:38:37 PM U