mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 05:11:29 +08:00
chore: slice replace loop (#2757)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
parent
22cfcbd5a1
commit
150dac9ead
@ -47,9 +47,7 @@ func (c *Command) Stderr() string {
|
||||
}
|
||||
|
||||
func (c *Command) AddArgs(args []string) {
|
||||
for _, arg := range args {
|
||||
c.args = append(c.args, arg)
|
||||
}
|
||||
c.args = append(c.args, args...)
|
||||
}
|
||||
|
||||
// CreateCommand returns a *Cmd struct that when run, will run the given command + args in the given directory
|
||||
|
@ -99,8 +99,6 @@ func Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)
|
||||
Key: key,
|
||||
Modifiers: []Modifier{modifier1, modifier2},
|
||||
}
|
||||
for _, extra := range rest {
|
||||
result.Modifiers = append(result.Modifiers, extra)
|
||||
}
|
||||
result.Modifiers = append(result.Modifiers, rest...)
|
||||
return result
|
||||
}
|
||||
|
@ -17,9 +17,7 @@ func (m *Menu) Append(item *MenuItem) {
|
||||
// Merge will append the items in the given menu
|
||||
// into this menu
|
||||
func (m *Menu) Merge(menu *Menu) {
|
||||
for _, item := range menu.Items {
|
||||
m.Items = append(m.Items, item)
|
||||
}
|
||||
m.Items = append(m.Items, menu.Items...)
|
||||
}
|
||||
|
||||
// AddText adds a TextMenu item to the menu
|
||||
|
Loading…
Reference in New Issue
Block a user