mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-09 23:27:58 +02:00
Add gocritic linter (#1324)
* Add gocritic linter `gocritic` provides diagnostics that check for bugs, performance, and style issues We disable the following checks: - commentFormatting - captLocal - deprecatedComment This PR contains many `//nolint:gocritic` to disable `appendAssign`.
This commit is contained in:
@ -463,14 +463,16 @@ func (m *Manager) actionToStr(action fw.Action) string {
|
||||
}
|
||||
|
||||
func (m *Manager) transformIPsetName(ipsetName string, sPort, dPort string) string {
|
||||
if ipsetName == "" {
|
||||
switch {
|
||||
case ipsetName == "":
|
||||
return ""
|
||||
} else if sPort != "" && dPort != "" {
|
||||
case sPort != "" && dPort != "":
|
||||
return ipsetName + "-sport-dport"
|
||||
} else if sPort != "" {
|
||||
case sPort != "":
|
||||
return ipsetName + "-sport"
|
||||
} else if dPort != "" {
|
||||
case dPort != "":
|
||||
return ipsetName + "-dport"
|
||||
default:
|
||||
return ipsetName
|
||||
}
|
||||
return ipsetName
|
||||
}
|
||||
|
Reference in New Issue
Block a user