-
Notifications
You must be signed in to change notification settings - Fork 110
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
Adding support for Go 1.16's FS interface #191
Comments
Yes, that adapter should be all you need to use 1.16's FS interface! |
I actually just found a way to do this without an extra type by using jets
it is a bit weird to require a "httpfs/http" package for something that just have to deal with filesystems but it works as expected. |
@advanderveer How did you pass this func loader to Jet Engine so it is loading files from I have someting like this:
handlers.go:
but I have no idea how to link this together :-) |
Hello again, I've tried this way:
where Repo.App.TemplatesFS stores:
But compiler does not like this part:
error: but Repo.App.TemplatesFS is embed.FS so it is the same type as in example from @advanderveer |
Ok I also found solution for my case:
the error was caused by wrong import - VSCode is suggesting:
instead of:
Now I am calling:
which is on the same level as Maybe not the best solution (because of passing Jet engine to app config - which I do not like very much for now) but for the beginning I think it is ok. When I learn more then problably will change that to maybe something more sophisticated. |
Addresses: CloudyKit#191
Go 1.16 introduces the fs package and a FS interface. Implementing a Jet loader for this seems like an ideal use case. Are there any plans for this, would it be easy?
EDIT: actually, maybe it is as simple as this?
The text was updated successfully, but these errors were encountered: