Module.New() does not need to return an error

This commit is contained in:
Matthew Holt
2019-05-21 14:22:21 -06:00
parent 67d32e6779
commit 2fd98cb040
19 changed files with 29 additions and 36 deletions

View File

@ -42,11 +42,7 @@ func StartAdmin(addr string) error {
///// END PPROF STUFF //////
for _, m := range GetModules("admin") {
moduleValue, err := m.New()
if err != nil {
return fmt.Errorf("initializing module '%s': %v", m.Name, err)
}
route := moduleValue.(AdminRoute)
route := m.New().(AdminRoute)
mux.Handle(route.Pattern, route)
}