go-bindata-assetfs
go-bindata-assetfs copied to clipboard
assetFS.Prefix does not behave as expected
The Prefix
property (and underlying code) does not behave as expected.
If one have data
directory with two files, for example, app.html
and index.html
, overall Prefix
property of assetFS
becomes equal to the path of one of the files in the dir (for example, Prefix = data/app.html
).
The Open()
call (as seen from sources) just prepends Prefix
field to the requested file name, which, considering the above, leads to unavailability of all packed files -- request to data/index.html
is translated to data/app.html/data/index.html
which is not quite correct.
If one is specifying the prefix explicitly with --prefix
key the software acts exactly the same.
A dirty resolution to the issue is to completely omit Prefix
field, then it works like a charm.