Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: insert entry during iterating over a map
Signed-off-by: fukua95 <[email protected]>
  • Loading branch information
cxljs committed Jun 8, 2025
commit b1090c1623e6d2c9571b6d701b979ec98deb2a2e
9 changes: 4 additions & 5 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3584,15 +3584,14 @@ func (c *cmdsInfoCache) Get(ctx context.Context) (map[string]*CommandInfo, error
return err
}

lowerCmds := make(map[string]*CommandInfo, len(cmds))

// Extensions have cmd names in upper case. Convert them to lower case.
for k, v := range cmds {
lower := internal.ToLower(k)
if lower != k {
cmds[lower] = v
}
lowerCmds[internal.ToLower(k)] = v
}

c.cmds = cmds
c.cmds = lowerCmds
return nil
})
return c.cmds, err
Expand Down
Loading