Skip to content

Commit 5cdb788

Browse files
committed
fixes ip/mask parse
1 parent 9a5a169 commit 5cdb788

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

flag_ip.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type ipValue struct {
1111

1212
func (v *ipValue) Set(value string) error {
1313
val := net.ParseIP(value)
14-
if val != nil {
14+
if val == nil {
1515
return fmt.Errorf("invalid ip: " + value)
1616
}
1717

flag_ip_mask.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type ipMaskValue struct {
1111

1212
func (v *ipMaskValue) Set(value string) error {
1313
val := parseIPv4Mask(value)
14-
if val != nil {
14+
if val == nil {
1515
return fmt.Errorf("invalid ip mask: " + value)
1616
}
1717

flag_ip_slice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type ipSliceValue struct {
1212

1313
func (v *ipSliceValue) Set(value string) error {
1414
val := net.ParseIP(value)
15-
if val != nil {
15+
if val == nil {
1616
return fmt.Errorf("invalid ip: " + value)
1717
}
1818

0 commit comments

Comments
 (0)