From 3effba0913b271b9284639653ba1e247cbddca64 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Mon, 8 Dec 2014 21:10:04 -0700 Subject: [PATCH] Correct directory permission of testDir When fs.MkdirAll() was called with a permission of "777" (without the 0 prefix), it generated the testDir with a permission of `dr----x--x`, causing the following error during a test run: === RUN TestRead0 --- FAIL: TestRead0 (0.00 seconds) fs_test.go:53: OsFs create failed: open /tmp/fun/test.txt: permission denied Changing the decimal `777` to octal `0777` fixes the problem. --- fs_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_test.go b/fs_test.go index 9246220..4fe6afe 100644 --- a/fs_test.go +++ b/fs_test.go @@ -44,7 +44,7 @@ var Fss = []Fs{&MemMapFs{}, &OsFs{}} func TestRead0(t *testing.T) { for _, fs := range Fss { path := testDir + "/" + testName - if err := fs.MkdirAll(testDir, 777); err != nil { + if err := fs.MkdirAll(testDir, 0777); err != nil { t.Fatal(fs.Name(), "unable to create dir", err) }