aboutsummaryrefslogtreecommitdiff
path: root/ip.go
diff options
context:
space:
mode:
authorDavid Rivera <[email protected]>2021-06-04 12:30:23 -0700
committerGitHub <[email protected]>2021-06-04 12:30:23 -0700
commitd5e0c0615acee7028e1e2740a11102313be88de1 (patch)
tree39d64ee9360352d5375bef758f25d423010f67f7 /ip.go
parent85dd5c8bc61cfa382fecd072378089d4e856579d (diff)
allow for blank ip addresses (#316)
Diffstat (limited to 'ip.go')
-rw-r--r--ip.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ip.go b/ip.go
index 3d414ba..06b8bcb 100644
--- a/ip.go
+++ b/ip.go
@@ -16,6 +16,9 @@ func newIPValue(val net.IP, p *net.IP) *ipValue {
func (i *ipValue) String() string { return net.IP(*i).String() }
func (i *ipValue) Set(s string) error {
+ if s == "" {
+ return nil
+ }
ip := net.ParseIP(strings.TrimSpace(s))
if ip == nil {
return fmt.Errorf("failed to parse IP: %q", s)