]> Cypherpunks repositories - gostls13.git/commitdiff
minor cleanup, not required by compiler changes
authorRuss Cox <rsc@golang.org>
Fri, 8 May 2009 17:14:55 +0000 (10:14 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 8 May 2009 17:14:55 +0000 (10:14 -0700)
R=r
DELTA=14  (1 added, 4 deleted, 9 changed)
OCL=28447
CL=28509

src/lib/http/triv.go
src/lib/net/ip_test.go
usr/dsymonds/iterable/iterable_test.go

index c452e2f5c32b3f2c3b467a44aa820381a22c6b89..d2e074d73da35765fb60b43bb838afda8d686199 100644 (file)
@@ -11,6 +11,7 @@ import (
        "fmt";
        "http";
        "io";
+       "log";
        "net";
        "os";
 )
@@ -110,7 +111,7 @@ func main() {
        http.Handle("/chan", ChanCreate());
        err := http.ListenAndServe(":12345", nil);
        if err != nil {
-               panic("ListenAndServe: ", err.String())
+               log.Crash("ListenAndServe: ", err)
        }
 }
 
index 1626f3156577ca7f2bf5fdcf33095ca3b27ee5fa..fb2ae8216dde26632f745aef15eb6c9ce3c22dd8 100644 (file)
@@ -9,11 +9,7 @@ import (
        "testing"
 )
 
-func ipv4(a, b, c, d byte) []byte {
-       return []byte{ 0,0,0,0, 0,0,0,0, 0,0,255,255, a,b,c,d }
-}
-
-func isEqual(a []byte, b []byte) bool {
+func isEqual(a, b IP) bool {
        if a == nil && b == nil {
                return true
        }
@@ -30,18 +26,18 @@ func isEqual(a []byte, b []byte) bool {
 
 type parseIPTest struct {
        in string;
-       out []byte;
+       out IP;
 }
 var parseiptests = []parseIPTest{
-       parseIPTest{"127.0.1.2", ipv4(127, 0, 1, 2)},
-       parseIPTest{"127.0.0.1", ipv4(127, 0, 0, 1)},
+       parseIPTest{"127.0.1.2", IPv4(127, 0, 1, 2)},
+       parseIPTest{"127.0.0.1", IPv4(127, 0, 0, 1)},
        parseIPTest{"127.0.0.256", nil},
        parseIPTest{"abc", nil},
-       parseIPTest{"::ffff:127.0.0.1", ipv4(127, 0, 0, 1)},
+       parseIPTest{"::ffff:127.0.0.1", IPv4(127, 0, 0, 1)},
        parseIPTest{"2001:4860:0:2001::68",
-               []byte{0x20,0x01, 0x48,0x60, 0,0, 0x20,0x01,
+               IP{0x20,0x01, 0x48,0x60, 0,0, 0x20,0x01,
                        0,0, 0,0, 0,0, 0x00,0x68}},
-       parseIPTest{"::ffff:4a7d:1363", ipv4(74, 125, 19, 99)},
+       parseIPTest{"::ffff:4a7d:1363", IPv4(74, 125, 19, 99)},
 }
 
 func TestParseIP(t *testing.T) {
index 9a772c2c4644c096221f278b29183e348e56e37e..8abba646e1d67e7313f459d7adaec910b5befa09 100644 (file)
@@ -22,7 +22,7 @@ func (arr IntArray) Iter() <-chan interface {} {
        return ch
 }
 
-var oneToFive IntArray = []int{ 1, 2, 3, 4, 5 };
+var oneToFive = IntArray{ 1, 2, 3, 4, 5 };
 
 func isNegative(n interface {}) bool {
        return n.(int) < 0