net: doc, doc-inspired cleanup

R=r
DELTA=368  (87 added, 14 deleted, 267 changed)
OCL=25773
CL=25786
This commit is contained in:
Russ Cox 2009-03-05 15:48:12 -08:00
parent 5bf0fbe7a8
commit c93da7c70a
15 changed files with 340 additions and 267 deletions

View file

@ -55,12 +55,12 @@ func (f *file) readLine() (s string, ok bool) {
return
}
func open(name string) *file {
func open(name string) (*file, *os.Error) {
fd, err := os.Open(name, os.O_RDONLY, 0);
if err != nil {
return nil
return nil, err;
}
return &file{fd, make([]byte, 1024)[0:0]};
return &file{fd, make([]byte, 1024)[0:0]}, nil;
}
func byteIndex(s string, c byte) int {