diff options
author | Matthew Holt <[email protected]> | 2019-05-21 14:22:21 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-05-21 14:22:21 -0600 |
commit | 2fd98cb040b617d2a018ae00a3a68b320de7dbc6 (patch) | |
tree | 91de4d369ec2a94c8f4fc3de4ba256945ad50297 /modules | |
parent | 67d32e6779b8e4f67fb0902b06210596371ead7f (diff) | |
download | caddy-2fd98cb040b617d2a018ae00a3a68b320de7dbc6.tar.gz caddy-2fd98cb040b617d2a018ae00a3a68b320de7dbc6.zip |
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 e5b9f61e3..09a130e17 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 d3110cc9c..f39fd8762 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 29805a2d3..819613184 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 19f5f68cc..c6a01ac3a 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 b56bbf9ca..e94fb54cb 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 13e122a4b..64a931253 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 1bfc9ad50..7e149d00e 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 9bd01c0bf..b7878a5cb 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 47fae229e..62ab7dd7b 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 8c3ebe0fc..fce426764 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 59fc7c36e..1e37b8608 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 fae2275a8..516c63258 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 9d46502c5..8ec982756 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 bda4ec2a0..e155efd66 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 4743e6b51..4e21adeaf 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) }, }) } |