Do not lint the protocol magic numbers

I happily use https://pkg.go.dev/golang.org/x/net/internal/iana, but it is internal
This commit is contained in:
Juan Font Alonso 2022-06-08 17:55:32 +02:00
parent ab1aac9f3e
commit 8287ba24b9

View file

@ -23,7 +23,7 @@ const (
errInvalidGroup = Error("invalid group") errInvalidGroup = Error("invalid group")
errInvalidTag = Error("invalid tag") errInvalidTag = Error("invalid tag")
errInvalidPortFormat = Error("invalid port format") errInvalidPortFormat = Error("invalid port format")
errWildcardIsNeeded = Error("wildcard as port is required for the procotol") errWildcardIsNeeded = Error("wildcard as port is required for the protocol")
) )
const ( const (
@ -267,7 +267,7 @@ func parseProtocol(protocol string) ([]int, bool, error) {
if err != nil { if err != nil {
return nil, false, err return nil, false, err
} }
needsWildcard := protocolNumber != 6 && protocolNumber != 17 && protocolNumber != 132 needsWildcard := protocolNumber != 6 && protocolNumber != 17 && protocolNumber != 132 // nolint
return []int{protocolNumber}, needsWildcard, nil return []int{protocolNumber}, needsWildcard, nil
} }