Switch from fmt.Sprintf to strings.Join for writing arguments in CommandRun

This commit is contained in:
2026-04-26 15:37:17 +05:00
parent 9cd17572b2
commit 8fb0306b1b
+2 -2
View File
@@ -1,7 +1,7 @@
package batch
import (
"fmt"
"strings"
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
"git.kor-elf.net/kor-elf-shield/go-nftables-client/internal/pkg"
@@ -18,6 +18,6 @@ func NewCommand(file *pkg.File) contract.CommandRun {
}
func (c *commandRun) Run(args ...string) error {
_, err := c.file.Write([]byte(fmt.Sprintf("%s\n", args)))
_, err := c.file.Write([]byte(strings.Join(args, " ")))
return err
}