Go 1.24 introduces the os.Root family of file APIs: https://go.dev/blog/osroot (cc @neild). These APIs are resistant to path traversal.
If I'm understanding things correctly, this is a replacement for safeopen. It may be a good idea to:
- Recommend users who can use Go 1.24+ to use
os.Root instead of safeopen.
- Reimplement safeopen on top of
os.Root.
- Deprecate (or mark with inline me annotations) the safeopen functions to users can migrate once Go 1.24 is two releases old.