Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The same race condition does happen in the implementation of os.MkdirAll[0], but that code there takes it into account and re-checks the second error (the one on Mkdir), and it ends up returning nil if the directory is indeed created, thus avoiding the race condition and making os.MkdirAll thread-safe. [0] https://github.com/golang/go/blob/e33f7c42b084182a3a88ef79857e33c11627159a/src/os/path.go#L19-L66
- Loading branch information