Skip to content

Conversation

@sean9999
Copy link
Contributor

@sean9999 sean9999 commented May 25, 2025

add support for os.Root.
see: https://go.dev/blog/osroot.

This code mainly sticks to just the task at hand, however in order to make CI tests pass, I had to do some very minor clean-ups.

I introduce the interface Root, which satisfies the same method-set as os.Root.

Root is basically a "chroot". It offers a root-relative view into a filesystem that you can't escape.

Root is powered by *rootFs, which simply wraps *BasePathFs, changing the signature slightly so that it satisfies the interface, and the functionality that os.Root provides.

@CLAassistant
Copy link

CLAassistant commented May 25, 2025

CLA assistant check
All committers have signed the CLA.

@sean9999 sean9999 force-pushed the 463-support-os-root branch 7 times, most recently from 8b2f983 to 9717843 Compare May 25, 2025 03:15
@sagikazarmark
Copy link
Collaborator

Thanks @sean9999

I think this is a great addition!

If you don't mind, I'd like to wait for 1.25 to be released: we usually try to support two versions.

@sean9999
Copy link
Contributor Author

sean9999 commented Aug 16, 2025

If you don't mind, I'd like to wait for 1.25 to be released: we usually try to support two versions.

It's time, boss! =)
https://go.dev/blog/go1.25

I had some "only v1.24" conditions in linter tests. I changed it to use >= v1.24.

I also rebased to the tip of master

- add method to Fs interface
- implement the method in all implementations
- added OpenRoot and OpenInRoot
- tests
- upgrade go version and some transient deps with vulns
@sean9999 sean9999 force-pushed the 463-support-os-root branch 4 times, most recently from 71d4759 to 4f005ee Compare August 16, 2025 16:27
@sean9999 sean9999 force-pushed the 463-support-os-root branch from 4f005ee to dc4f19e Compare August 16, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants