Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
63629d53
Commit
63629d53
authored
May 08, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanup, not required by compiler changes
R=r DELTA=14 (1 added, 4 deleted, 9 changed) OCL=28447 CL=28509
parent
b3b3e0da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
triv.go
src/lib/http/triv.go
+2
-1
ip_test.go
src/lib/net/ip_test.go
+7
-11
iterable_test.go
usr/dsymonds/iterable/iterable_test.go
+1
-1
No files found.
src/lib/http/triv.go
View file @
63629d53
...
...
@@ -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
)
}
}
src/lib/net/ip_test.go
View file @
63629d53
...
...
@@ -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"
,
ip
v4
(
127
,
0
,
1
,
2
)},
parseIPTest
{
"127.0.0.1"
,
ip
v4
(
127
,
0
,
0
,
1
)},
parseIPTest
{
"127.0.1.2"
,
IP
v4
(
127
,
0
,
1
,
2
)},
parseIPTest
{
"127.0.0.1"
,
IP
v4
(
127
,
0
,
0
,
1
)},
parseIPTest
{
"127.0.0.256"
,
nil
},
parseIPTest
{
"abc"
,
nil
},
parseIPTest
{
"::ffff:127.0.0.1"
,
ip
v4
(
127
,
0
,
0
,
1
)},
parseIPTest
{
"::ffff:127.0.0.1"
,
IP
v4
(
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"
,
ip
v4
(
74
,
125
,
19
,
99
)},
parseIPTest
{
"::ffff:4a7d:1363"
,
IP
v4
(
74
,
125
,
19
,
99
)},
}
func
TestParseIP
(
t
*
testing
.
T
)
{
...
...
usr/dsymonds/iterable/iterable_test.go
View file @
63629d53
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment