mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
go2idl: don't mutate a map being iterated
This was causing us to process packages we didn't really want, which was only visible when debugging was enabled.
This commit is contained in:
parent
96c0284e91
commit
ab16ccc158
@ -337,7 +337,13 @@ func (b *Builder) typeCheckPackage(id string) (*tc.Package, error) {
|
||||
|
||||
func (b *Builder) makePackages() error {
|
||||
b.pkgs = map[string]*tc.Package{}
|
||||
|
||||
// Take a snapshot to iterate, since this will recursively mutate b.parsed.
|
||||
keys := []string{}
|
||||
for id := range b.parsed {
|
||||
keys = append(keys, id)
|
||||
}
|
||||
for _, id := range keys {
|
||||
// We have to check here even though we made a new one above,
|
||||
// because typeCheckPackage follows the import graph, which may
|
||||
// cause a package to be filled before we get to it in this
|
||||
|
Loading…
Reference in New Issue
Block a user