mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 17:39:58 +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) {
|
func (c *Command) AddArgs(args []string) {
|
||||||
for _, arg := range args {
|
c.args = append(c.args, args...)
|
||||||
c.args = append(c.args, arg)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateCommand returns a *Cmd struct that when run, will run the given command + args in the given directory
|
// 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,
|
Key: key,
|
||||||
Modifiers: []Modifier{modifier1, modifier2},
|
Modifiers: []Modifier{modifier1, modifier2},
|
||||||
}
|
}
|
||||||
for _, extra := range rest {
|
result.Modifiers = append(result.Modifiers, rest...)
|
||||||
result.Modifiers = append(result.Modifiers, extra)
|
|
||||||
}
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,7 @@ func (m *Menu) Append(item *MenuItem) {
|
|||||||
// Merge will append the items in the given menu
|
// Merge will append the items in the given menu
|
||||||
// into this menu
|
// into this menu
|
||||||
func (m *Menu) Merge(menu *Menu) {
|
func (m *Menu) Merge(menu *Menu) {
|
||||||
for _, item := range menu.Items {
|
m.Items = append(m.Items, menu.Items...)
|
||||||
m.Items = append(m.Items, item)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddText adds a TextMenu item to the menu
|
// AddText adds a TextMenu item to the menu
|
||||||
|
Loading…
Reference in New Issue
Block a user