ubuntu / zsys

ZSys daemon and client for zfs systems
GNU General Public License v3.0
301 stars 43 forks source link

Port from vfs to embed #254

Closed xnox closed 9 months ago

xnox commented 1 year ago

I didn't yet test this to behave correctly under all conditions, so do not merge yet, only a proposal.

I don't quite see the need to use external vfsgen & httpfs, when golang internal embed can satisfy such requirements directly.

At the moment we only read/embed a single file, which can be directly embedded as a binary variable.

If we ever need to expand to more files, standard library embed too supports a vfs like object.

shurcool/vsgen supports compression, however given how small the single file is that we embed, the extra dependencies that it pulls in results in no saving in the binary size.

didrocks commented 1 year ago

I think the context you are missing is that go:embed didn’t exist when zsys was written :) (it started to be built-in with go 1.16 IIRC)