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