~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/godoc/filesystem.go

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
}
122
122
 
123
123
func (root osFS) ReadDir(path string) ([]os.FileInfo, error) {
124
 
        return ioutil.ReadDir(root.resolve(path)) // is sorted
 
124
        fis, err := ioutil.ReadDir(path) // is sorted
 
125
        if err != nil {
 
126
                return nil, err
 
127
        }
 
128
        // Replace symlinks with what they are pointing to
 
129
        dirPrefix := path + "/"
 
130
        for i, fi := range fis {
 
131
                if fi.Mode() & os.ModeSymlink != 0 {
 
132
                        fi, err = os.Stat(dirPrefix + fi.Name())
 
133
                        if err != nil {
 
134
                                return nil, err
 
135
                        }
 
136
                }
 
137
                fis[i] = fi
 
138
        }
 
139
        return fis, nil
125
140
}
126
141
 
127
142
// hasPathPrefix returns true if x == y or x == y + "/" + more