refactor: Use pointers for controllers
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
|||||||
type Controller struct {
|
type Controller struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Controller) New() controller.Controller {
|
func (*Controller) New() controller.Controller {
|
||||||
return &Controller{}
|
return &Controller{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ type Controller struct {
|
|||||||
serviceRepository repository.Service
|
serviceRepository repository.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Controller) New() controller.Controller {
|
func (c *Controller) New() controller.Controller {
|
||||||
return &Controller{
|
return &Controller{
|
||||||
serviceRepository: repository.NewServiceRepository(),
|
serviceRepository: repository.NewServiceRepository(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import (
|
|||||||
|
|
||||||
func getControllers() []controller.Controller {
|
func getControllers() []controller.Controller {
|
||||||
return []controller.Controller{
|
return []controller.Controller{
|
||||||
ping.Controller{}.New(),
|
new(ping.Controller).New(),
|
||||||
service.Controller{}.New(),
|
new(service.Controller).New(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user