Methods / Functions
Prefer functions over methods when -
- Dependency on the state is not required
- You can perform this function on any type that implements a specific interface which means you don’t need to restrict this function to belong to a specific type.
https://medium.com/@ishagirdhar/methods-vs-functions-in-golang-c60586bfa6b4