diff options
Diffstat (limited to 'internal/config/types.go')
| -rw-r--r-- | internal/config/types.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/internal/config/types.go b/internal/config/types.go index c2296975f..d88468e3d 100644 --- a/internal/config/types.go +++ b/internal/config/types.go @@ -18,9 +18,8 @@ package config import ( + "errors" "net/netip" - - "codeberg.org/gruf/go-byteutil" ) // IPPrefixes is a type-alias for []netip.Prefix @@ -28,6 +27,9 @@ import ( type IPPrefixes []netip.Prefix func (p *IPPrefixes) Set(in string) error { + if p == nil { + return errors.New("nil receiver") + } prefix, err := netip.ParsePrefix(in) if err != nil { return err @@ -36,20 +38,6 @@ func (p *IPPrefixes) Set(in string) error { return nil } -func (p *IPPrefixes) String() string { - if p == nil || len(*p) == 0 { - return "" - } - var buf byteutil.Buffer - for _, prefix := range *p { - str := prefix.String() - buf.B = append(buf.B, str...) - buf.B = append(buf.B, ',') - } - buf.Truncate(1) - return buf.String() -} - func (p *IPPrefixes) Strings() []string { if p == nil || len(*p) == 0 { return nil |
