Skip to content

Commit 0ec6f0f

Browse files
authored
Merge pull request kubernetes#77111 from JieJhih/iptables/golint
Code style update
2 parents b4cc2a5 + 098a7c5 commit 0ec6f0f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

pkg/util/iptables/iptables.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,25 +401,23 @@ func (runner *runner) restoreInternal(args []string, data []byte, flush FlushFla
401401
func iptablesSaveCommand(protocol Protocol) string {
402402
if protocol == ProtocolIpv6 {
403403
return cmdIP6TablesSave
404-
} else {
405-
return cmdIPTablesSave
406404
}
405+
return cmdIPTablesSave
407406
}
408407

409408
func iptablesRestoreCommand(protocol Protocol) string {
410409
if protocol == ProtocolIpv6 {
411410
return cmdIP6TablesRestore
412-
} else {
413-
return cmdIPTablesRestore
414411
}
412+
return cmdIPTablesRestore
413+
415414
}
416415

417416
func iptablesCommand(protocol Protocol) string {
418417
if protocol == ProtocolIpv6 {
419418
return cmdIP6Tables
420-
} else {
421-
return cmdIPTables
422419
}
420+
return cmdIPTables
423421
}
424422

425423
func (runner *runner) run(op operation, args []string) ([]byte, error) {
@@ -579,9 +577,9 @@ func getIPTablesWaitFlag(vstring string) []string {
579577
}
580578
if version.LessThan(minVersion) {
581579
return []string{WaitString}
582-
} else {
583-
return []string{WaitString, WaitSecondsValue}
584580
}
581+
return []string{WaitString, WaitSecondsValue}
582+
585583
}
586584

587585
// getIPTablesVersionString runs "iptables --version" to get the version string
@@ -656,9 +654,9 @@ func (runner *runner) dbusSignalHandler(bus utildbus.Connection) {
656654
switch s.Name {
657655
case "org.freedesktop.DBus.NameOwnerChanged":
658656
name := s.Body[0].(string)
659-
new_owner := s.Body[2].(string)
657+
newOwner := s.Body[2].(string)
660658

661-
if name != firewalldName || len(new_owner) == 0 {
659+
if name != firewalldName || len(newOwner) == 0 {
662660
continue
663661
}
664662

0 commit comments

Comments
 (0)