mirror of https://github.com/spf13/afero.git
Improve code in Readme
This patch makes the code in readme valid. The previous code had a few typos.
This commit is contained in:
parent
7711a1eb64
commit
944579a3fc
|
@ -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:
|
Then in my tests I would initialize a new MemMapFs for each test:
|
||||||
```go
|
```go
|
||||||
func TestExist(t *testing.T) {
|
func TestExist(t *testing.T) {
|
||||||
appFS = afero.NewMemMapFs()
|
appFS := afero.NewMemMapFs()
|
||||||
// create test files and directories
|
// 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/a/b", []byte("file b"), 0644)
|
||||||
afero.WriteFile(appFS, "src/c", []byte("file c"), 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) {
|
if os.IsNotExist(err) {
|
||||||
t.Errorf("file \"%s\" does not exist.\n", name)
|
t.Errorf("file \"%s\" does not exist.\n", name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Available Backends
|
# Available Backends
|
||||||
|
|
Loading…
Reference in New Issue