Fix linting errors

This commit is contained in:
Patrick Pacher
2024-03-27 16:17:58 +01:00
parent 653a365bce
commit 61176af14e
48 changed files with 167 additions and 153 deletions

View File

@@ -4,6 +4,7 @@ package nfq
import (
"encoding/binary"
"errors"
"fmt"
ct "github.com/florianl/go-conntrack"
@@ -35,7 +36,7 @@ func TeardownNFCT() {
// DeleteAllMarkedConnection deletes all marked entries from the conntrack table.
func DeleteAllMarkedConnection() error {
if nfct == nil {
return fmt.Errorf("nfq: nfct not initialized")
return errors.New("nfq: nfct not initialized")
}
// Delete all ipv4 marked connections
@@ -87,7 +88,7 @@ func deleteMarkedConnections(nfct *ct.Nfct, f ct.Family) (deleted int) {
// DeleteMarkedConnection removes a specific connection from the conntrack table.
func DeleteMarkedConnection(conn *network.Connection) error {
if nfct == nil {
return fmt.Errorf("nfq: nfct not initialized")
return errors.New("nfq: nfct not initialized")
}
con := ct.Con{