]> Cypherpunks.ru repositories - nncp.git/commitdiff
Remove unnecessary len()
authorSergey Matveev <stargrave@stargrave.org>
Sun, 17 Jan 2021 16:40:56 +0000 (19:40 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 17 Jan 2021 16:40:56 +0000 (19:40 +0300)
src/toss.go

index 682c46122331518a4858eb26b9c4fa0204eeea67..75e01c4d93633bb27572dca3b0d6e088814f6d31 100644 (file)
@@ -155,7 +155,7 @@ func (ctx *Ctx) Toss(
                        if !dryRun {
                                cmd := exec.Command(
                                        cmdline[0],
-                                       append(cmdline[1:len(cmdline)], args...)...,
+                                       append(cmdline[1:], args...)...,
                                )
                                cmd.Env = append(
                                        cmd.Env,
@@ -182,7 +182,7 @@ func (ctx *Ctx) Toss(
                                        if exists {
                                                cmd := exec.Command(
                                                        sendmail[0],
-                                                       append(sendmail[1:len(sendmail)], notify.To)...,
+                                                       append(sendmail[1:], notify.To)...,
                                                )
                                                cmd.Stdin = newNotification(notify, fmt.Sprintf(
                                                        "Exec from %s: %s", sender.Name, argsStr,
@@ -303,7 +303,7 @@ func (ctx *Ctx) Toss(
                                if len(sendmail) > 0 && ctx.NotifyFile != nil {
                                        cmd := exec.Command(
                                                sendmail[0],
-                                               append(sendmail[1:len(sendmail)], ctx.NotifyFile.To)...,
+                                               append(sendmail[1:], ctx.NotifyFile.To)...,
                                        )
                                        cmd.Stdin = newNotification(ctx.NotifyFile, fmt.Sprintf(
                                                "File from %s: %s (%s)",
@@ -372,7 +372,7 @@ func (ctx *Ctx) Toss(
                                if len(sendmail) > 0 && ctx.NotifyFreq != nil {
                                        cmd := exec.Command(
                                                sendmail[0],
-                                               append(sendmail[1:len(sendmail)], ctx.NotifyFreq.To)...,
+                                               append(sendmail[1:], ctx.NotifyFreq.To)...,
                                        )
                                        cmd.Stdin = newNotification(ctx.NotifyFreq, fmt.Sprintf(
                                                "Freq from %s: %s", sender.Name, src,