>From my point of view, the main difference is that interfaces are strictly
more powerful, because you can't dynamically type convert a function
type into something different.
You can always make an interface from a function (e.g. http.HandlerFunc
and the like) but not the other way around.
This
Hi,
I am wondering from best practice point of view whether it is better to use
interface or first-class function, especially considering that Go encourages
the use of small interfaces. Here is an example:
type SomethingDoer interface{
DoSomething(data Data)
}
func PerformWork(doer Somethin