-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embed.FS broken on Windows #12
Comments
Hi @shemanaev, Thanks for bringing up this point and for your research! I'll have to have a look at how best to solve the problem while remaining compatible with the normal and embedded filesystem. As a temporary fix, you could use a custom revolver with fsLoader, errFS := spreak.NewFilesystemLoader(
spreak.WithResolver(&yourResolver{}),
spreak.WithFs(yourFs),
) |
That took longer than it should have. Unfortunately, there is no way to determine if it is an embedded filesystem. But according to the fs documentation, slashes should be used as path separators for fs.FS implementations anyway. However, I have now created a new release, with which it should also work under Windows. Thanks for your report. |
Everything works perfect now. Thank you! 👍 |
Summary
Go uses forward slashes for
embed.FS
even on Windows builds and loader can't find files with names made withfilepath.Join
.Relevant issues: golang/go#45230, golang/go#44305
Steps to reproduce
Move
locale/es.po
tolocale/es/helloworld.po
in example.Expected behavior
Load locales.
Observed behavior (that appears unintentional)
It doesn't load 😄.
The text was updated successfully, but these errors were encountered: