| 180 | } |
| 181 | |
| 182 | func (f *TempDirFixture) tearDown() { |
| 183 | if f.oldDir != "" { |
| 184 | err := os.Chdir(f.oldDir) |
| 185 | if err != nil { |
| 186 | f.t.Fatal(err) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | err := f.dir.TearDown() |
| 191 | if err != nil && runtime.GOOS == "windows" && |
| 192 | (strings.Contains(err.Error(), "The process cannot access the file") || |
| 193 | strings.Contains(err.Error(), "Access is denied")) { |
| 194 | // NOTE(nick): I'm not convinced that this is a real problem. |
| 195 | // I think it might just be clean up of file notification I/O. |
| 196 | } else if err != nil { |
| 197 | f.t.Fatal(err) |
| 198 | } |
| 199 | } |