Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: error return by os.RemoveAll is not compatible with os.IsNotExist #7776
What steps will reproduce the problem? 1. http://play.golang.org/p/2oDie7N4Hd What is the expected output? What do you see instead? Expected: the workers race to delete the directory tree, there is a high probability that some will race to delete a directory that has already been deleted. In that case os.IsNotExist() should identify the error Got: lucky(~/devel/issue) % go run issue.go 2014/04/14 11:07:18 creating temporary directories rooted at "/tmp/issue866430634" 2014/04/14 11:07:18 preparing workers 2014/04/14 11:07:18 release the swarm 2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file or directory" 2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file or directory" 2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file or directory" Please use labels and text to provide additional information. Because syscall.ENOENT is wrapped in an *os.SyscallError the check in error_unix.go fails.
error wrapping is (always) a problem for Go packages. similar bug(s) are also reported for the net package. should we fix it for Go 1.3? I think we probably should do an extensive audit of all OS-interfacing packages for similar problems in Go 1.4.
Labels changed: added release-go1.3maybe, repo-main.
Status changed to Accepted.
This issue was closed.