Skip to content

Commit

Permalink
Correctly pass os.PathError from fs mock Openfile function)
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Dec 23, 2014
1 parent 2591924 commit 67cdddb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sysfs/fs_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sysfs

import (
"errors"
"fmt"
"os"
"time"
)
Expand Down Expand Up @@ -84,7 +83,7 @@ func (fs *MockFilesystem) OpenFile(name string, flag int, perm os.FileMode) (fil
f.Closed = false
return f, nil
} else {
return (*MockFile)(nil), errors.New(fmt.Sprintf("%v: No such file.", name))
return (*MockFile)(nil), &os.PathError{Err: errors.New(name + ": No such file.")}
}
}

Expand Down

0 comments on commit 67cdddb

Please sign in to comment.