5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 07:09:54 +08:00

chore: slice replace loop (#2757)

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guangwu 2023-07-13 21:13:47 +08:00 committed by GitHub
parent 22cfcbd5a1
commit 150dac9ead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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