Skip to content

Commit

Permalink
Fix panic in workspace.Locate when encountering filesystem errors (se…
Browse files Browse the repository at this point in the history
  • Loading branch information
rjackson authored and nywilken committed Jun 23, 2018
1 parent 29544e6 commit e46def4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workspace/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func (ws Workspace) Locate(exercise string) ([]string, error) {
var paths []string
// Look through the entire workspace tree to find any matches.
walkFn := func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

// If it's a symlink, follow it, then get the file info of the target.
if info.Mode()&os.ModeSymlink == os.ModeSymlink {
src, err := filepath.EvalSymlinks(path)
Expand Down

0 comments on commit e46def4

Please sign in to comment.