mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 02:02:26 -04:00
chore: Remove unnecessary explicit type parameters
This commit is contained in:
parent
4ebcfed9c9
commit
1975408d89
@ -191,7 +191,7 @@ func (st ServerType) Setup(
|
|||||||
metrics, _ := options["metrics"].(*caddyhttp.Metrics)
|
metrics, _ := options["metrics"].(*caddyhttp.Metrics)
|
||||||
for _, s := range servers {
|
for _, s := range servers {
|
||||||
if s.Metrics != nil {
|
if s.Metrics != nil {
|
||||||
metrics = cmp.Or[*caddyhttp.Metrics](metrics, &caddyhttp.Metrics{})
|
metrics = cmp.Or(metrics, &caddyhttp.Metrics{})
|
||||||
metrics = &caddyhttp.Metrics{
|
metrics = &caddyhttp.Metrics{
|
||||||
PerHost: metrics.PerHost || s.Metrics.PerHost,
|
PerHost: metrics.PerHost || s.Metrics.PerHost,
|
||||||
}
|
}
|
||||||
@ -350,7 +350,7 @@ func (st ServerType) Setup(
|
|||||||
|
|
||||||
// avoid duplicates by sorting + compacting
|
// avoid duplicates by sorting + compacting
|
||||||
sort.Strings(defaultLog.Exclude)
|
sort.Strings(defaultLog.Exclude)
|
||||||
defaultLog.Exclude = slices.Compact[[]string, string](defaultLog.Exclude)
|
defaultLog.Exclude = slices.Compact(defaultLog.Exclude)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// we may have not actually added anything, so remove if empty
|
// we may have not actually added anything, so remove if empty
|
||||||
|
@ -207,7 +207,7 @@ func (app *App) Provision(ctx caddy.Context) error {
|
|||||||
|
|
||||||
if srv.Metrics != nil {
|
if srv.Metrics != nil {
|
||||||
srv.logger.Warn("per-server 'metrics' is deprecated; use 'metrics' in the root 'http' app instead")
|
srv.logger.Warn("per-server 'metrics' is deprecated; use 'metrics' in the root 'http' app instead")
|
||||||
app.Metrics = cmp.Or[*Metrics](app.Metrics, &Metrics{
|
app.Metrics = cmp.Or(app.Metrics, &Metrics{
|
||||||
init: sync.Once{},
|
init: sync.Once{},
|
||||||
httpMetrics: &httpMetrics{},
|
httpMetrics: &httpMetrics{},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user