Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
55e790a1
Commit
55e790a1
authored
Jul 01, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up some BUG/TODO in go code
R=r DELTA=23 (1 added, 12 deleted, 10 changed) OCL=30957 CL=30980
parent
20cfa4a5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
22 deletions
+11
-22
src/pkg/bufio/bufio.go
src/pkg/bufio/bufio.go
+1
-4
src/pkg/flag/flag.go
src/pkg/flag/flag.go
+1
-1
src/pkg/io/io.go
src/pkg/io/io.go
+1
-3
src/pkg/net/dnsclient.go
src/pkg/net/dnsclient.go
+0
-1
src/pkg/net/dnsconfig.go
src/pkg/net/dnsconfig.go
+1
-4
src/pkg/net/ip.go
src/pkg/net/ip.go
+0
-1
src/pkg/net/net.go
src/pkg/net/net.go
+6
-5
src/pkg/os/path_test.go
src/pkg/os/path_test.go
+1
-3
No files found.
src/pkg/bufio/bufio.go
View file @
55e790a1
...
@@ -270,9 +270,7 @@ func (b *Reader) ReadLineSlice(delim byte) (line []byte, err os.Error) {
...
@@ -270,9 +270,7 @@ func (b *Reader) ReadLineSlice(delim byte) (line []byte, err os.Error) {
return
nil
,
ErrBufferFull
return
nil
,
ErrBufferFull
}
}
}
}
panic
(
"not reached"
);
// BUG 6g bug100
return
nil
,
nil
}
}
// ReadLineBytes reads until the first occurrence of delim in the input,
// ReadLineBytes reads until the first occurrence of delim in the input,
...
@@ -323,7 +321,6 @@ func (b *Reader) ReadLineBytes(delim byte) (line []byte, err os.Error) {
...
@@ -323,7 +321,6 @@ func (b *Reader) ReadLineBytes(delim byte) (line []byte, err os.Error) {
full
=
make
([][]
byte
,
16
);
full
=
make
([][]
byte
,
16
);
}
else
if
nfull
>=
len
(
full
)
{
}
else
if
nfull
>=
len
(
full
)
{
newfull
:=
make
([][]
byte
,
len
(
full
)
*
2
);
newfull
:=
make
([][]
byte
,
len
(
full
)
*
2
);
// BUG slice assignment
for
i
:=
0
;
i
<
len
(
full
);
i
++
{
for
i
:=
0
;
i
<
len
(
full
);
i
++
{
newfull
[
i
]
=
full
[
i
];
newfull
[
i
]
=
full
[
i
];
}
}
...
...
src/pkg/flag/flag.go
View file @
55e790a1
...
@@ -48,7 +48,7 @@ import (
...
@@ -48,7 +48,7 @@ import (
"strconv"
"strconv"
)
)
// BUG: atob belongs elsewhere
//
TODO(r):
BUG: atob belongs elsewhere
func
atob
(
str
string
)
(
value
bool
,
ok
bool
)
{
func
atob
(
str
string
)
(
value
bool
,
ok
bool
)
{
switch
str
{
switch
str
{
case
"1"
,
"t"
,
"T"
,
"true"
,
"TRUE"
,
"True"
:
case
"1"
,
"t"
,
"T"
,
"true"
,
"TRUE"
,
"True"
:
...
...
src/pkg/io/io.go
View file @
55e790a1
...
@@ -117,9 +117,7 @@ func ReadAtLeast(r Reader, buf []byte, min int) (n int, err os.Error) {
...
@@ -117,9 +117,7 @@ func ReadAtLeast(r Reader, buf []byte, min int) (n int, err os.Error) {
// If an EOF happens after reading some but not all the bytes,
// If an EOF happens after reading some but not all the bytes,
// ReadFull returns ErrUnexpectedEOF.
// ReadFull returns ErrUnexpectedEOF.
func
ReadFull
(
r
Reader
,
buf
[]
byte
)
(
n
int
,
err
os
.
Error
)
{
func
ReadFull
(
r
Reader
,
buf
[]
byte
)
(
n
int
,
err
os
.
Error
)
{
// TODO(rsc): 6g bug keeps us from writing the obvious 1-liner
return
ReadAtLeast
(
r
,
buf
,
len
(
buf
));
n
,
err
=
ReadAtLeast
(
r
,
buf
,
len
(
buf
));
return
;
}
}
// Copyn copies n bytes (or until an error) from src to dst.
// Copyn copies n bytes (or until an error) from src to dst.
...
...
src/pkg/net/dnsclient.go
View file @
55e790a1
...
@@ -88,7 +88,6 @@ func _Exchange(cfg *_DNS_Config, c Conn, name string) (m *_DNS_Msg, err os.Error
...
@@ -88,7 +88,6 @@ func _Exchange(cfg *_DNS_Config, c Conn, name string) (m *_DNS_Msg, err os.Error
// Find answer for name in dns message.
// Find answer for name in dns message.
// On return, if err == nil, addrs != nil.
// On return, if err == nil, addrs != nil.
// TODO(rsc): Maybe return []IP instead?
func
answer
(
name
,
server
string
,
dns
*
_DNS_Msg
)
(
addrs
[]
string
,
err
*
DNSError
)
{
func
answer
(
name
,
server
string
,
dns
*
_DNS_Msg
)
(
addrs
[]
string
,
err
*
DNSError
)
{
addrs
=
make
([]
string
,
0
,
len
(
dns
.
answer
));
addrs
=
make
([]
string
,
0
,
len
(
dns
.
answer
));
...
...
src/pkg/net/dnsconfig.go
View file @
55e790a1
...
@@ -29,10 +29,7 @@ var _DNS_configError os.Error;
...
@@ -29,10 +29,7 @@ var _DNS_configError os.Error;
// of the host name to get the default search domain.
// of the host name to get the default search domain.
// We assume it's in resolv.conf anyway.
// We assume it's in resolv.conf anyway.
func
_DNS_ReadConfig
()
(
*
_DNS_Config
,
os
.
Error
)
{
func
_DNS_ReadConfig
()
(
*
_DNS_Config
,
os
.
Error
)
{
// TODO(rsc): 6g won't let me say file, err :=
file
,
err
:=
open
(
"/etc/resolv.conf"
);
var
file
*
file
;
var
err
os
.
Error
;
file
,
err
=
open
(
"/etc/resolv.conf"
);
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
src/pkg/net/ip.go
View file @
55e790a1
...
@@ -346,7 +346,6 @@ L: for j < IPv6len {
...
@@ -346,7 +346,6 @@ L: for j < IPv6len {
if
p4
==
nil
{
if
p4
==
nil
{
return
nil
return
nil
}
}
// BUG: p[j:j+4] = p4
p
[
j
]
=
p4
[
12
];
p
[
j
]
=
p4
[
12
];
p
[
j
+
1
]
=
p4
[
13
];
p
[
j
+
1
]
=
p4
[
13
];
p
[
j
+
2
]
=
p4
[
14
];
p
[
j
+
2
]
=
p4
[
14
];
...
...
src/pkg/net/net.go
View file @
55e790a1
...
@@ -777,11 +777,12 @@ func (l *ListenerUnix) AcceptUnix() (c *ConnUnix, raddr string, err os.Error) {
...
@@ -777,11 +777,12 @@ func (l *ListenerUnix) AcceptUnix() (c *ConnUnix, raddr string, err os.Error) {
// Accept implements the Accept method in the Listener interface;
// Accept implements the Accept method in the Listener interface;
// it waits for the next call and returns a generic Conn.
// it waits for the next call and returns a generic Conn.
func
(
l
*
ListenerUnix
)
Accept
()
(
c
Conn
,
raddr
string
,
err
os
.
Error
)
{
func
(
l
*
ListenerUnix
)
Accept
()
(
c
Conn
,
raddr
string
,
err
os
.
Error
)
{
// TODO(rsc): 6g bug prevents saying
// TODO(rsc): Should return l.AcceptUnix() be okay here?
// c, raddr, err = l.AcceptUnix();
// There is a type conversion -- the first return arg of
// return;
// l.AcceptUnix() is *ConnUnix and it gets converted to Conn
c1
,
r1
,
e1
:=
l
.
AcceptUnix
();
// in the explicit assignment.
return
c1
,
r1
,
e1
;
c
,
raddr
,
err
=
l
.
AcceptUnix
();
return
;
}
}
...
...
src/pkg/os/path_test.go
View file @
55e790a1
...
@@ -109,9 +109,7 @@ func TestRemoveAll(t *testing.T) {
...
@@ -109,9 +109,7 @@ func TestRemoveAll(t *testing.T) {
t
.
Fatalf
(
"MkdirAll %q: %s"
,
dpath
,
err
);
t
.
Fatalf
(
"MkdirAll %q: %s"
,
dpath
,
err
);
}
}
// TODO(rsc): toss tmp once bug152 is fixed
for
i
,
s
:=
range
[]
string
{
fpath
,
dpath
+
"/file1"
,
path
+
"/zzz"
}
{
tmp
:=
[]
string
{
fpath
,
dpath
+
"/file1"
,
path
+
"/zzz"
};
for
i
,
s
:=
range
tmp
{
fd
,
err
=
os
.
Open
(
s
,
os
.
O_WRONLY
|
os
.
O_CREAT
,
0666
);
fd
,
err
=
os
.
Open
(
s
,
os
.
O_WRONLY
|
os
.
O_CREAT
,
0666
);
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"create %q: %s"
,
s
,
err
);
t
.
Fatalf
(
"create %q: %s"
,
s
,
err
);
...
...
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