Skip to content

Commit

Permalink
Allow specifying empty list for CIDRSliceFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed Mar 20, 2024
1 parent 8e02522 commit c90eda9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/flags/cidrslice.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package flags

import (
"fmt"
"strings"

"github.com/spf13/pflag"
Expand All @@ -25,7 +24,8 @@ func (f *cidrSliceFlag) String() string {

func (f *cidrSliceFlag) Set(value string) error {
if value == "" {
return fmt.Errorf("value cannot be empty")
f.value = []string{}
return nil
}

cidrs := strings.Split(value, ",")
Expand Down

0 comments on commit c90eda9

Please sign in to comment.