mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
Module.New() does not need to return an error
This commit is contained in:
parent
67d32e6779
commit
2fd98cb040
19 changed files with 29 additions and 36 deletions
6
admin.go
6
admin.go
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue