Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this commit fixes the issue #6224 #6227

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions caddyconfig/caddyfile/importgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import (
type adjacency map[string][]string

type importGraph struct {
nodes map[string]bool
nodes map[string]struct{}
edges adjacency
}

func (i *importGraph) addNode(name string) {
if i.nodes == nil {
i.nodes = make(map[string]bool)
i.nodes = make(map[string]struct{})
}
if _, exists := i.nodes[name]; exists {
return
}
i.nodes[name] = true
i.nodes[name] = struct{}{}
}

func (i *importGraph) addNodes(names []string) {
Expand Down Expand Up @@ -66,7 +66,7 @@ func (i *importGraph) addEdge(from, to string) error {
}

if i.nodes == nil {
i.nodes = make(map[string]bool)
i.nodes = make(map[string]struct{})
}
if i.edges == nil {
i.edges = make(adjacency)
Expand Down
2 changes: 1 addition & 1 deletion caddyconfig/caddyfile/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Parse(filename string, input []byte) ([]ServerBlock, error) {
p := parser{
Dispenser: NewDispenser(tokens),
importGraph: importGraph{
nodes: make(map[string]bool),
nodes: make(map[string]struct{}),
edges: make(adjacency),
},
}
Expand Down
Loading