Bindatafs combines the Afero file system abstraction with file embedding of go-bindata.
go get github.com/Schobers/bindatafs
- Install go-bindata
- Generate your bindata using go-bindata
- Create an bindatafs file system instance:
var fs afero.Fs = bindatafs.NewFs(MustAsset, AssetInfo, AssetNames)
or
var fs afero.Fs = &bindatafs.Fs{Asset: MustAsset, Info: AssetInfo, Names: AssetNames}
Bindatafs works with any fork of go-bindata that provides the same API as the original, namely the methods MustAsset, AssetInfo and AssetNames. Tested with: