Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b180de5

Browse files
author
Doug Davis
committed
Remove duplicate call to net.ParseIP
and a little cleanup Signed-off-by: Doug Davis <[email protected]>
1 parent 159f5e0 commit b180de5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

opts/ip.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ func (o *IpOpt) Set(val string) error {
2222
if ip == nil {
2323
return fmt.Errorf("%s is not an ip address", val)
2424
}
25-
(*o.IP) = net.ParseIP(val)
25+
*o.IP = ip
2626
return nil
2727
}
2828

2929
func (o *IpOpt) String() string {
30-
return (*o.IP).String()
30+
return o.IP.String()
3131
}

0 commit comments

Comments
 (0)