diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-21 14:22:21 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-21 14:22:21 -0600 |
commit | 2fd98cb040b617d2a018ae00a3a68b320de7dbc6 (patch) | |
tree | 91de4d369ec2a94c8f4fc3de4ba256945ad50297 /modules | |
parent | 67d32e6779b8e4f67fb0902b06210596371ead7f (diff) |
Module.New() does not need to return an error
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/caddyhttp.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/caddylog/log.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/fileserver/matcher.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/fileserver/staticfiles.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/headers/headers.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/matchers.go | 18 | ||||
-rwxr-xr-x | modules/caddyhttp/reverseproxy/module.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/rewrite/rewrite.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/staticresp.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/table.go | 4 | ||||
-rw-r--r-- | modules/caddytls/acmemanager.go | 2 | ||||
-rw-r--r-- | modules/caddytls/fileloader.go | 2 | ||||
-rw-r--r-- | modules/caddytls/folderloader.go | 2 | ||||
-rw-r--r-- | modules/caddytls/matchers.go | 2 | ||||
-rw-r--r-- | modules/caddytls/tls.go | 2 |
15 files changed, 24 insertions, 24 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go index e5b9f61..09a130e 100644 --- a/modules/caddyhttp/caddyhttp.go +++ b/modules/caddyhttp/caddyhttp.go @@ -22,7 +22,7 @@ func init() { err := caddy2.RegisterModule(caddy2.Module{ Name: "http", - New: func() (interface{}, error) { return new(App), nil }, + New: func() interface{} { return new(App) }, }) if err != nil { diff --git a/modules/caddyhttp/caddylog/log.go b/modules/caddyhttp/caddylog/log.go index d3110cc..f39fd87 100644 --- a/modules/caddyhttp/caddylog/log.go +++ b/modules/caddyhttp/caddylog/log.go @@ -12,7 +12,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.middleware.log", - New: func() (interface{}, error) { return new(Log), nil }, + New: func() interface{} { return new(Log) }, }) } diff --git a/modules/caddyhttp/fileserver/matcher.go b/modules/caddyhttp/fileserver/matcher.go index 29805a2..8196131 100644 --- a/modules/caddyhttp/fileserver/matcher.go +++ b/modules/caddyhttp/fileserver/matcher.go @@ -11,7 +11,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.file", - New: func() (interface{}, error) { return new(FileMatcher), nil }, + New: func() interface{} { return new(FileMatcher) }, }) } diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go index 19f5f68..c6a01ac 100644 --- a/modules/caddyhttp/fileserver/staticfiles.go +++ b/modules/caddyhttp/fileserver/staticfiles.go @@ -21,7 +21,7 @@ func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.responders.file_server", - New: func() (interface{}, error) { return new(FileServer), nil }, + New: func() interface{} { return new(FileServer) }, }) } diff --git a/modules/caddyhttp/headers/headers.go b/modules/caddyhttp/headers/headers.go index b56bbf9..e94fb54 100644 --- a/modules/caddyhttp/headers/headers.go +++ b/modules/caddyhttp/headers/headers.go @@ -11,7 +11,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.middleware.headers", - New: func() (interface{}, error) { return new(Headers), nil }, + New: func() interface{} { return new(Headers) }, }) } diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 13e122a..64a9312 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -32,39 +32,39 @@ type ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.host", - New: func() (interface{}, error) { return matchHost{}, nil }, + New: func() interface{} { return matchHost{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.path", - New: func() (interface{}, error) { return matchPath{}, nil }, + New: func() interface{} { return matchPath{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.path_regexp", - New: func() (interface{}, error) { return new(matchPathRE), nil }, + New: func() interface{} { return new(matchPathRE) }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.method", - New: func() (interface{}, error) { return matchMethod{}, nil }, + New: func() interface{} { return matchMethod{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.query", - New: func() (interface{}, error) { return matchQuery{}, nil }, + New: func() interface{} { return matchQuery{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.header", - New: func() (interface{}, error) { return matchHeader{}, nil }, + New: func() interface{} { return matchHeader{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.header_regexp", - New: func() (interface{}, error) { return matchHeaderRE{}, nil }, + New: func() interface{} { return matchHeaderRE{} }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.protocol", - New: func() (interface{}, error) { return new(matchProtocol), nil }, + New: func() interface{} { return new(matchProtocol) }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.starlark_expr", - New: func() (interface{}, error) { return new(matchStarlarkExpr), nil }, + New: func() interface{} { return new(matchStarlarkExpr) }, }) } diff --git a/modules/caddyhttp/reverseproxy/module.go b/modules/caddyhttp/reverseproxy/module.go index 1bfc9ad..7e149d0 100755 --- a/modules/caddyhttp/reverseproxy/module.go +++ b/modules/caddyhttp/reverseproxy/module.go @@ -8,6 +8,6 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.responders.reverse_proxy", - New: func() (interface{}, error) { return new(LoadBalanced), nil }, + New: func() interface{} { return new(LoadBalanced) }, }) } diff --git a/modules/caddyhttp/rewrite/rewrite.go b/modules/caddyhttp/rewrite/rewrite.go index 9bd01c0..b7878a5 100644 --- a/modules/caddyhttp/rewrite/rewrite.go +++ b/modules/caddyhttp/rewrite/rewrite.go @@ -12,7 +12,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.middleware.rewrite", - New: func() (interface{}, error) { return new(Rewrite), nil }, + New: func() interface{} { return new(Rewrite) }, }) } diff --git a/modules/caddyhttp/staticresp.go b/modules/caddyhttp/staticresp.go index 47fae22..62ab7dd 100644 --- a/modules/caddyhttp/staticresp.go +++ b/modules/caddyhttp/staticresp.go @@ -11,7 +11,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.responders.static", - New: func() (interface{}, error) { return new(Static), nil }, + New: func() interface{} { return new(Static) }, }) } diff --git a/modules/caddyhttp/table.go b/modules/caddyhttp/table.go index 8c3ebe0..fce4267 100644 --- a/modules/caddyhttp/table.go +++ b/modules/caddyhttp/table.go @@ -9,12 +9,12 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.middleware.table", - New: func() (interface{}, error) { return new(tableMiddleware), nil }, + New: func() interface{} { return new(tableMiddleware) }, }) caddy2.RegisterModule(caddy2.Module{ Name: "http.matchers.table", - New: func() (interface{}, error) { return new(tableMatcher), nil }, + New: func() interface{} { return new(tableMatcher) }, }) } diff --git a/modules/caddytls/acmemanager.go b/modules/caddytls/acmemanager.go index 59fc7c3..1e37b86 100644 --- a/modules/caddytls/acmemanager.go +++ b/modules/caddytls/acmemanager.go @@ -15,7 +15,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "tls.management.acme", - New: func() (interface{}, error) { return new(acmeManagerMaker), nil }, + New: func() interface{} { return new(acmeManagerMaker) }, }) } diff --git a/modules/caddytls/fileloader.go b/modules/caddytls/fileloader.go index fae2275..516c632 100644 --- a/modules/caddytls/fileloader.go +++ b/modules/caddytls/fileloader.go @@ -11,7 +11,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "tls.certificates.load_files", - New: func() (interface{}, error) { return fileLoader{}, nil }, + New: func() interface{} { return fileLoader{} }, }) } diff --git a/modules/caddytls/folderloader.go b/modules/caddytls/folderloader.go index 9d46502..8ec9827 100644 --- a/modules/caddytls/folderloader.go +++ b/modules/caddytls/folderloader.go @@ -16,7 +16,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "tls.certificates.load_folders", - New: func() (interface{}, error) { return folderLoader{}, nil }, + New: func() interface{} { return folderLoader{} }, }) } diff --git a/modules/caddytls/matchers.go b/modules/caddytls/matchers.go index bda4ec2..e155efd 100644 --- a/modules/caddytls/matchers.go +++ b/modules/caddytls/matchers.go @@ -12,7 +12,7 @@ type MatchServerName []string func init() { caddy2.RegisterModule(caddy2.Module{ Name: "tls.handshake_match.host", - New: func() (interface{}, error) { return MatchServerName{}, nil }, + New: func() interface{} { return MatchServerName{} }, }) } diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index 4743e6b..4e21ade 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -15,7 +15,7 @@ import ( func init() { caddy2.RegisterModule(caddy2.Module{ Name: "tls", - New: func() (interface{}, error) { return new(TLS), nil }, + New: func() interface{} { return new(TLS) }, }) } |