Mock calls to system functions to facilitate unit testing

This commit is contained in:
Solomon Hykes
2013-11-20 20:05:10 +00:00
parent 2382a0f920
commit 92f94f06ae
4 changed files with 25 additions and 10 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ func FindLoopDeviceFor(file *os.File) *os.File {
for i := 0; true; i++ {
path := fmt.Sprintf("/dev/loop%d", i)
file, err := os.OpenFile(path, os.O_RDWR, 0)
file, err := OSOpenFile(path, os.O_RDWR, 0)
if err != nil {
if os.IsNotExist(err) {
return nil