I have two files, generic_handler.go, which essentially looks like this:
type Handler struct{
fields map[string]interface{}
}
func (handler *Handler) addField(key string, value interface{}){ some code }
And stat_handler.go:
type StatHandler Handler
When I try to call (from within the stat_handler.go file) the method like this, I get an error:
//inside some function
stathandler.addField("some field", "some value")
It errors out with type StatHandler has no field or method addField
. This is the same even if I export addField
by making it AddField
. Both of these files reside in the same package.
Is there something I am missing?