fix: fix IsValidSubnet
This commit is contained in:
parent
5b41f57423
commit
77f9e75654
@ -9,7 +9,10 @@ import (
|
||||
|
||||
func IsValidSubnet(subnet string) error {
|
||||
_, _, err := net.ParseCIDR(subnet)
|
||||
return fmt.Errorf("failed to parse subnet: %w", err)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse subnet: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func IsIpInSubnet(ctx context.Context, ip string, subnet string) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user