OS-agnostic filesystems
One of the newest and more exciting developments in the latest Go releases is the new io/fs
and embed
packages, which were introduced in Go 1.16.
While we have shown agnostic access to our local filesystem via the os
package, as well as agnostic file pathing manipulation through filepath
, we haven't seen an agnostic way of accessing an entire filesystem.
In the cloud era, files are just as likely to be in filesystems that exist in remote data centers such as Microsoft Azure's Blob Storage, Google Cloud's Filestore, or Amazon AWS's EFS as they are on local disk.
Each of these filesystems comes with a client for accessing the files in Go, but they are specific to that network service. We can't treat each of these in the same way as I treat my local filesystem. io/fs
is meant to provide a foundation to help solve this problem.
Another problem is that many files must be packaged with that binary, often in a container definition...