mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
Use maps.Copy for simpler map handling (#7009)
Signed-off-by: eveneast <qcqs@foxmail.com>
This commit is contained in:
parent
8524386737
commit
a76d005a94
3 changed files with 9 additions and 18 deletions
|
@ -16,6 +16,7 @@ package httpcaddyfile
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"maps"
|
||||
"net"
|
||||
"slices"
|
||||
"sort"
|
||||
|
@ -365,9 +366,7 @@ func parseSegmentAsConfig(h Helper) ([]ConfigValue, error) {
|
|||
// copy existing matcher definitions so we can augment
|
||||
// new ones that are defined only in this scope
|
||||
matcherDefs := make(map[string]caddy.ModuleMap, len(h.matcherDefs))
|
||||
for key, val := range h.matcherDefs {
|
||||
matcherDefs[key] = val
|
||||
}
|
||||
maps.Copy(matcherDefs, h.matcherDefs)
|
||||
|
||||
// find and extract any embedded matcher definitions in this scope
|
||||
for i := 0; i < len(segments); i++ {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue