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