We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7a0b958 + fe217ab commit 966c25fCopy full SHA for 966c25f
pkg/netutil/subnet/subnet.go
@@ -111,12 +111,12 @@ func LastIPInSubnet(addr *net.IPNet) (net.IP, error) {
111
}
112
ones, bits := cidr.Mask.Size()
113
if ones == bits {
114
- return cidr.IP, err
+ return cidr.IP, nil
115
116
for i := range cidr.IP {
117
cidr.IP[i] = cidr.IP[i] | ^cidr.Mask[i]
118
119
120
121
122
// firstIPInSubnet gets the first IP in a subnet
@@ -129,8 +129,8 @@ func FirstIPInSubnet(addr *net.IPNet) (net.IP, error) {
129
130
131
132
133
134
cidr.IP[len(cidr.IP)-1]++
135
136
0 commit comments