From 944579a3fcaa65a618594e80d3d5c249c34f24e7 Mon Sep 17 00:00:00 2001 From: Laurent Charignon Date: Tue, 8 Nov 2016 16:08:59 -0800 Subject: [PATCH] Improve code in Readme This patch makes the code in readme valid. The previous code had a few typos. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index db20817..d9e3327 100644 --- a/README.md +++ b/README.md @@ -198,17 +198,17 @@ independent, with no test relying on the state left by an earlier test. Then in my tests I would initialize a new MemMapFs for each test: ```go func TestExist(t *testing.T) { - appFS = afero.NewMemMapFs() + appFS := afero.NewMemMapFs() // create test files and directories - appFS.MkdirAll("src/a", 0755)) + appFS.MkdirAll("src/a", 0755) afero.WriteFile(appFS, "src/a/b", []byte("file b"), 0644) afero.WriteFile(appFS, "src/c", []byte("file c"), 0644) - _, err := appFS.Stat("src/c") + name := "src/c" + _, err := appFS.Stat(name) if os.IsNotExist(err) { - t.Errorf("file \"%s\" does not exist.\n", name) + t.Errorf("file \"%s\" does not exist.\n", name) } } - ``` # Available Backends