Oohh Go 1.24 brings os.Root, which allows you to open a directory and present its contents using the FS (filesystem) interface. It prevents access to files outside the root, meaning malicious/erroneous code will not be able to operate on parts of the filesystem that they should not be touching.
So it's a little sandboxing feature in Go's standard lib. Nice!
Official announcement: https://tip.golang.org/doc/go1.24
https://pkg.go.dev/os@master#Root
via @antonz:
https://c.im/@antonz/113820837861807347
=> More informations about this toot | More toots from teleclimber@social.tchncs.de
text/gemini
This content has been proxied by September (ba2dc).