Is it permitted to use the Remove method of os.Root to remove the base directory opened by os.OpenRoot? In other words, what should be the result of this snippet?
root, _ := os.OpenRoot("/tmp/foo")
root.Remove(".")
Is it forbidden? Permitted, but might not work depending on the OS (like attempting to Remove the current working directory)? Or permitted and expected to work everywhere?
I can't find anything in the package documentation to say that applying Remove to the base directory is forbidden. But
CL 661595 added a test TestRootRemoveDot which expects this operation to fail. This breaks Plan 9 builders, where the operation doesn't fail (as reported in
#73863 about 10 days ago).
I'd like to fix this so Plan 9 builds can resume. But I don't know whether the correct fix is to make Remove on Plan 9 check for removing the base directory, to skip the test on Plan 9, or to remove the test altogether (because it's testing an OS restriction, not testing a defined go behaviour).
Can someone with authority please advise?