util/slicesx: add AppendNonzero
By request of @agottardo. Updates #cleanup Change-Id: I2f02314eb9533b1581e47b66b45b6fb8ac257bb7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
17022ad0e9
commit
8b65598614
@@ -242,7 +242,7 @@ change in the future.
|
||||
}
|
||||
|
||||
func nonNilCmds(cmds ...*ffcli.Command) []*ffcli.Command {
|
||||
return slicesx.Filter(cmds[:0], cmds, func(c *ffcli.Command) bool { return c != nil })
|
||||
return slicesx.AppendNonzero(cmds[:0], cmds)
|
||||
}
|
||||
|
||||
func fatalf(format string, a ...any) {
|
||||
|
||||
Reference in New Issue
Block a user