Revert "(#501) make IP.String() method return something sensible"

This reverts commit b1c9612158.
This commit is contained in:
Ron Evans
2023-05-19 14:02:33 +02:00
parent 422051d822
commit de2742f10c
2 changed files with 1 additions and 18 deletions
+1 -4
View File
@@ -357,10 +357,7 @@ func ParseIP(s string) IP {
// String returns the string form of the IP address ip.
func (ip IP) String() string {
if len(ip) < 4 {
return ""
}
return strconv.Itoa(int(ip[0])) + "." + strconv.Itoa(int(ip[1])) + "." + strconv.Itoa(int(ip[2])) + "." + strconv.Itoa(int(ip[3]))
return string(ip)
}
// Conn is a generic stream-oriented network connection.
-14
View File
@@ -1,14 +0,0 @@
package net
import (
"testing"
qt "github.com/frankban/quicktest"
)
func TestIPAddressString(t *testing.T) {
c := qt.New(t)
ipaddr := ParseIP("127.0.0.1")
c.Assert(ipaddr.String(), qt.Equals, "127.0.0.1")
}