chore: use gofumpt for code formatting
This commit is contained in:
@@ -33,7 +33,8 @@ func isDeleteMatchInstruction(instruction string) bool {
|
||||
}
|
||||
|
||||
func deleteIPTablesRule(ctx context.Context, iptablesBinary, instruction string,
|
||||
runner CmdRunner, logger Logger) (err error) {
|
||||
runner CmdRunner, logger Logger,
|
||||
) (err error) {
|
||||
targetRule, err := parseIptablesInstruction(instruction)
|
||||
if err != nil {
|
||||
return fmt.Errorf("parsing iptables command: %w", err)
|
||||
@@ -69,9 +70,12 @@ func deleteIPTablesRule(ctx context.Context, iptablesBinary, instruction string,
|
||||
// It returns 0 if the rule is not found.
|
||||
func findLineNumber(ctx context.Context, iptablesBinary string,
|
||||
instruction iptablesInstruction, runner CmdRunner, logger Logger) (
|
||||
lineNumber uint16, err error) {
|
||||
listFlags := []string{"-t", instruction.table, "-L", instruction.chain,
|
||||
"--line-numbers", "-n", "-v"}
|
||||
lineNumber uint16, err error,
|
||||
) {
|
||||
listFlags := []string{
|
||||
"-t", instruction.table, "-L", instruction.chain,
|
||||
"--line-numbers", "-n", "-v",
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, iptablesBinary, listFlags...) // #nosec G204
|
||||
logger.Debug(cmd.String())
|
||||
output, err := runner.Run(cmd)
|
||||
|
||||
Reference in New Issue
Block a user