go-bindata-assetfs icon indicating copy to clipboard operation
go-bindata-assetfs copied to clipboard

assetFS.Prefix does not behave as expected

Open khaos-one opened this issue 10 years ago • 0 comments

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.

khaos-one avatar Feb 20 '15 20:02 khaos-one