more lint driven refactoring

This commit is contained in:
evilsocket 2018-04-24 18:26:16 +02:00
commit 0de6f3a76e
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
57 changed files with 168 additions and 241 deletions

View file

@ -54,7 +54,7 @@ func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string {
fmt.Sprintf("listenport=%d", r.SrcPort),
}
if enabled == true {
if enabled {
rule = append(rule, fmt.Sprintf("connectport=%d", r.DstPort))
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress))
rule = append(rule, fmt.Sprintf("protocol=%s", r.Protocol))
@ -93,7 +93,7 @@ func (f *WindowsFirewall) EnableRedirection(r *Redirection, enabled bool) error
}
rule := f.generateRule(r, enabled)
if enabled == true {
if enabled {
rule = append([]string{"interface", "portproxy", "add", "v4tov4"}, rule...)
} else {
rule = append([]string{"interface", "portproxy", "delete", "v4tov4"}, rule...)