func (wf *widgetFactory) registerWidget(wi widget_iface) {
	widget := wi.getInfo()
	wf.widgets = append(wf.widgets, &widget)
}
registerWidget takes a pointer to the widgetFactory and stores the new widget in the factory
Note: this state may not be suitable for most functional programming paradigms
package factory_method_with_registry
type maker_iface interface {
	makeWidget(w widget) widget_iface
	registerWidget(widget_iface)
}
type widget_iface interface {
	getInfo() widget
}
type factory struct {
}
func (self *factory) create(factory maker_iface, w widget) widget_iface {
	widget := factory.makeWidget(w)
	factory.registerWidget(widget)
	return widget
}
type widget struct {
	name string
	count int
}
func (w *widget) getInfo() widget {
	return *w
}
type widgetFactory struct {
	*factory
	widgets []*widget
}
func (self *widgetFactory) makeWidget(w widget) widget_iface {
	return &widget{w.name, w.count}
}