Switch from fmt.Sprintf to strings.Join for writing arguments in CommandRun
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package batch
|
package batch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"strings"
|
||||||
|
|
||||||
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
|
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
|
||||||
"git.kor-elf.net/kor-elf-shield/go-nftables-client/internal/pkg"
|
"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 {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user