-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow symlinks in fs temp paths? #202
Comments
That seems reasonable, but I wonder if it might break other uses where symlinks aren't resolved. I need to think about it a bit more. One option might be to add a PathOp something like https://github.com/gotestyourself/gotest.tools/blob/v3.0.2/fs/path.go#L140-L145, which either sets a new field on the |
When does this become a problem? Is it when calling I suspect one workaround is to set the I'm thinking a PathOp may not be a good option after all. A new |
A I ran into this when setting |
Do you mean https://golang.org/pkg/os/#Chdir, or |
This was for some code which creates & sets the working directory. The flow was:
|
For that case, since the code being tested explicitly resolves symlinks, it seems like the test should also resolve symlinks in the expected path. I think the new method would only be necessary if the comparison is done with |
On OSX, the default temp dir includes a symlink, this means that if you generate a temporary file, and then pass its path into a function which follows links, then assertions you try and make on matching names won't pass.
Would it be reasonable to have
fs.NewDir
andfs.NewFile
expand to real paths before returning?The text was updated successfully, but these errors were encountered: