Given the following types :
type A struct {
...
}
func (a *A) Process() {
...
}
I would like to pass the method process
of the type A
to another function and be able to access the content of the underlying instance of A
.
How should i pass the method to another function? Via a pointer? And how should it be called ?
The Process()
method won't modify the instance of A
, i am using a pointer on the method receiver because the struct is quite large. The idea behind my question is to avoid declaring the function Process()
outside the struct and pass a ton of arguments to it (instead it access to the members of the struct).