瀏覽代碼

Remove duplicate call to net.ParseIP
and a little cleanup

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis 10 年之前
父節點
當前提交
b180de55ca
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      opts/ip.go

+ 2 - 2
opts/ip.go

@@ -22,10 +22,10 @@ func (o *IpOpt) Set(val string) error {
 	if ip == nil {
 	if ip == nil {
 		return fmt.Errorf("%s is not an ip address", val)
 		return fmt.Errorf("%s is not an ip address", val)
 	}
 	}
-	(*o.IP) = net.ParseIP(val)
+	*o.IP = ip
 	return nil
 	return nil
 }
 }
 
 
 func (o *IpOpt) String() string {
 func (o *IpOpt) String() string {
-	return (*o.IP).String()
+	return o.IP.String()
 }
 }