os: DirFS has interaction with Chdir #47214
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
This is something that may not be significant enough to address, but I thought it was worth raising.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Given a main.go from https://play.golang.org/p/Tccj4KWcX7X
What did you see?
I saw exactly what I expected, but it could be something that may surprise some users.
Given that the
DirFS
was handed a relative path, it's entirely reasonable for reads subsequent to a chdir to be now relative to the new working directory, but it may be worth clarifying that theDirFS
does not hold an absolute path as its root unless it was handed one or some other way to indicate that chdir will alter the effective filesystem that's seen.The text was updated successfully, but these errors were encountered: