func walkDir(path string) {
        v := make(fileVisitor)
        go func() {
-               filepath.Walk(path, v)
+               filepath.Walk(path, v, v)
                close(v)
        }()
        for err := range v {
        }
 }
 
-func (v fileVisitor) Error(path string, err os.Error) {
-       v <- err
-}
-
 func isGoFile(f *os.FileInfo) bool {
        // ignore non-Go files
        return f.IsRegular() && !strings.HasPrefix(f.Name, ".") && strings.HasSuffix(f.Name, ".go")
 
        }
 }
 
-func (v fileVisitor) Error(path string, err os.Error) {
-       v <- err
-}
-
 func walkDir(path string) {
        v := make(fileVisitor)
        go func() {
-               filepath.Walk(path, v)
+               filepath.Walk(path, v, v)
                close(v)
        }()
        for err := range v {
 
 // Visitor for filepath.Walk - trivial.  Just calls doFile on each file.
 // TODO: if govet becomes richer, might want to process
 // a directory (package) at a time.
-type fileVisitor chan os.Error
+type V struct{}
 
-func (v fileVisitor) VisitDir(path string, f *os.FileInfo) bool {
+func (v V) VisitDir(path string, f *os.FileInfo) bool {
        return true
 }
 
-func (v fileVisitor) VisitFile(path string, f *os.FileInfo) {
+func (v V) VisitFile(path string, f *os.FileInfo) {
        if strings.HasSuffix(path, ".go") {
                doFile(path, nil)
        }
 }
 
-func (v fileVisitor) Error(path string, err os.Error) {
-       v <- err
-}
-
 // walkDir recursively walks the tree looking for .go files.
 func walkDir(root string) {
-       v := make(fileVisitor)
+       errors := make(chan os.Error)
        done := make(chan bool)
        go func() {
-               for e := range v {
+               for e := range errors {
                        errorf("walk error: %s", e)
                }
                done <- true
        }()
-       filepath.Walk(root, v)
-       close(v)
+       filepath.Walk(root, V{}, errors)
+       close(errors)
        <-done
 }
 
 
 }
 
 // Visitor methods are invoked for corresponding file tree entries
-// visited by Walk.
+// visited by Walk. The parameter path is the full path of f relative
+// to root.
 type Visitor interface {
        VisitDir(path string, f *os.FileInfo) bool
        VisitFile(path string, f *os.FileInfo)
-       Error(path string, err os.Error)
 }
 
-func walk(path string, f *os.FileInfo, v Visitor) {
+func walk(path string, f *os.FileInfo, v Visitor, errors chan<- os.Error) {
        if !f.IsDirectory() {
                v.VisitFile(path, f)
                return
 
        list, err := readDir(path)
        if err != nil {
-               v.Error(path, err)
+               if errors != nil {
+                       errors <- err
+               }
        }
 
        for _, e := range list {
-               walk(Join(path, e.Name), e, v)
+               walk(Join(path, e.Name), e, v, errors)
        }
 }
 
 // v.VisitFile for each directory or file in the tree, including root.
 // If v.VisitDir returns false, Walk skips the directory's entries;
 // otherwise it invokes itself for each directory entry in sorted order.
-// Walk calls v.Error if an error happens while reading a directory.
-func Walk(root string, v Visitor) {
+// An error reading a directory does not abort the Walk.
+// If errors != nil, Walk sends each directory read error
+// to the channel.  Otherwise Walk discards the error.
+func Walk(root string, v Visitor, errors chan<- os.Error) {
        f, err := os.Lstat(root)
        if err != nil {
-               v.Error(root, err)
+               if errors != nil {
+                       errors <- err
+               }
                return // can't progress
        }
-       walk(root, f, v)
+       walk(root, f, v, errors)
 }
 
 // Base returns the last element of path.
 
        })
 }
 
-type TestVisitor chan os.Error
+type TestVisitor struct{}
 
-func (v TestVisitor) VisitDir(path string, f *os.FileInfo) bool {
+func (v *TestVisitor) VisitDir(path string, f *os.FileInfo) bool {
        mark(f.Name)
        return true
 }
 
-func (v TestVisitor) VisitFile(path string, f *os.FileInfo) {
+func (v *TestVisitor) VisitFile(path string, f *os.FileInfo) {
        mark(f.Name)
 }
 
-func (v TestVisitor) Error(path string, err os.Error) {
-       v <- err
-}
-
 func TestWalk(t *testing.T) {
        makeTree(t)
 
-       v := make(TestVisitor, 64)
+       // 1) ignore error handling, expect none
+       v := &TestVisitor{}
+       filepath.Walk(tree.name, v, nil)
+       checkMarks(t)
 
-       // 1) no errors expected.
-       filepath.Walk(tree.name, v)
+       // 2) handle errors, expect none
+       errors := make(chan os.Error, 64)
+       filepath.Walk(tree.name, v, errors)
        select {
-       case err := <-v:
+       case err := <-errors:
                t.Errorf("no error expected, found: %s", err)
        default:
                // ok
                tree.entries[1].mark--
                tree.entries[3].mark--
 
-               // 2) expect two errors
+               // 3) handle errors, expect two
+               errors = make(chan os.Error, 64)
                os.Chmod(filepath.Join(tree.name, tree.entries[1].name), 0)
-               filepath.Walk(tree.name, v)
+               filepath.Walk(tree.name, v, errors)
        Loop:
                for i := 1; i <= 2; i++ {
                        select {
-                       case <-v:
+                       case <-errors:
                                // ok
                        default:
                                t.Errorf("%d. error expected, none found", i)
                        }
                }
                select {
-               case err := <-v:
+               case err := <-errors:
                        t.Errorf("only two errors expected, found 3rd: %v", err)
                default:
                        // ok