return nil, ErrBufferFull
}
}
-
- // BUG 6g bug100
- return nil, nil
+ panic("not reached");
}
// ReadLineBytes reads until the first occurrence of delim in the input,
full = make([][]byte, 16);
} else if nfull >= len(full) {
newfull := make([][]byte, len(full)*2);
- // BUG slice assignment
for i := 0; i < len(full); i++ {
newfull[i] = full[i];
}
"strconv"
)
-// BUG: atob belongs elsewhere
+// TODO(r): BUG: atob belongs elsewhere
func atob(str string) (value bool, ok bool) {
switch str {
case "1", "t", "T", "true", "TRUE", "True":
// If an EOF happens after reading some but not all the bytes,
// ReadFull returns ErrUnexpectedEOF.
func ReadFull(r Reader, buf []byte) (n int, err os.Error) {
- // TODO(rsc): 6g bug keeps us from writing the obvious 1-liner
- n, err = ReadAtLeast(r, buf, len(buf));
- return;
+ return ReadAtLeast(r, buf, len(buf));
}
// Copyn copies n bytes (or until an error) from src to dst.
// Find answer for name in dns message.
// 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) {
addrs = make([]string, 0, len(dns.answer));
// of the host name to get the default search domain.
// We assume it's in resolv.conf anyway.
func _DNS_ReadConfig() (*_DNS_Config, os.Error) {
- // TODO(rsc): 6g won't let me say file, err :=
- var file *file;
- var err os.Error;
- file, err = open("/etc/resolv.conf");
+ file, err := open("/etc/resolv.conf");
if err != nil {
return nil, err
}
if p4 == nil {
return nil
}
- // BUG: p[j:j+4] = p4
p[j] = p4[12];
p[j+1] = p4[13];
p[j+2] = p4[14];
// Accept implements the Accept method in the Listener interface;
// it waits for the next call and returns a generic Conn.
func (l *ListenerUnix) Accept() (c Conn, raddr string, err os.Error) {
- // TODO(rsc): 6g bug prevents saying
- // c, raddr, err = l.AcceptUnix();
- // return;
- c1, r1, e1 := l.AcceptUnix();
- return c1, r1, e1;
+ // TODO(rsc): Should return l.AcceptUnix() be okay here?
+ // There is a type conversion -- the first return arg of
+ // l.AcceptUnix() is *ConnUnix and it gets converted to Conn
+ // in the explicit assignment.
+ c, raddr, err = l.AcceptUnix();
+ return;
}
t.Fatalf("MkdirAll %q: %s", dpath, err);
}
- // TODO(rsc): toss tmp once bug152 is fixed
- tmp := []string{fpath, dpath+"/file1", path+"/zzz"};
- for i, s := range tmp {
+ for i, s := range []string{fpath, dpath+"/file1", path+"/zzz"} {
fd, err = os.Open(s, os.O_WRONLY | os.O_CREAT, 0666);
if err != nil {
t.Fatalf("create %q: %s", s, err);