Skip to content

Commit 3c5f094

Browse files
committed
fix: replace fmt.Errorf with errors.New for mixed IP family error handling in expandIPPoolAddressesInternal
1 parent 6e236f3 commit 3c5f094

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/util/ippool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package util
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"math/big"
78
"net"
@@ -48,8 +49,7 @@ func expandIPPoolAddressesInternal(entries []string, checkMixedIPFamily bool) ([
4849
hasIPv4 := false
4950
hasIPv6 := false
5051

51-
var addUnique func(cidr string)
52-
addUnique = func(cidr string) {
52+
addUnique := func(cidr string) {
5353
if _, exists := seen[cidr]; !exists {
5454
seen[cidr] = struct{}{}
5555
// Detect IP family if check is enabled
@@ -95,7 +95,7 @@ func expandIPPoolAddressesInternal(entries []string, checkMixedIPFamily bool) ([
9595

9696
// Check for mixed IP families if enabled (OVN address set limitation)
9797
if checkMixedIPFamily && hasIPv4 && hasIPv6 {
98-
return nil, fmt.Errorf("mixed IPv4 and IPv6 addresses are not supported in OVN address set")
98+
return nil, errors.New("mixed IPv4 and IPv6 addresses are not supported in OVN address set")
9999
}
100100

101101
// Convert set to sorted slice

0 commit comments

Comments
 (0)