Using Go 1.11.x with the echo framework.
I have the following struct and function
type AccountController struct {
....
}
func (c *AccountController) ActiveAccountID() int {
....
return 5
}
Now I want to access the ActiveAccountID
from another struct, this is how i did it,
type TestController struct {
Account *AccountController
}
func (c *TestController) AddData(ec echo.Context) error {
....
id := c.Account.ActiveAccountID()
....
}
But when I print / use the id var, it just gives me a memory pointer error?
I have tried the account controller to remove the pointer but i still got the memory pointer issue. So what am I doing wrong?
Thanks,