-
Notifications
You must be signed in to change notification settings - Fork 118
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
Feature Request: be able to use both go-bindata and go-bindata-assetfs at the same time #20
Comments
You can already, but thet will have to be in separate (sub) packages which
|
@timhughes when using
|
cool |
Why does go-bindata-assetfs require it's own command? Can you not implement http.FIleSystem through the go-bindata table of contents? |
@jbowens this is to create the actual go files containing the data. |
@elazarl Right. My question is how it differs from It seems to me you could use type BindataPkg struct {
Asset func(string) ([]byte, error)
AssetInfo func(string) (os.FileInfo, error)
AssetDir func(name string) ([]string, error)
}
func FileSystem(bindata BindataPkg) http.FileSystem {
// ...
} Then instead of having to use a separate command for fs := assetfs.FileSystem(BindataPkg{
Asset: myassetspkg.Asset,
AssetInfo: myassetspkg.AssetInfo,
AssetDir: myassetspkg.AssetDir,
})
mux.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(fs))) Why does |
Ah, sorry, I see. That's literally what |
I would like to use
go-bindata-assetfs
for serving static assets such as javascript and css but then usego-bindata
for my templates but when I do I get naming clashes. I also do not want to serve my templates usinghttp.FileSystem
. I think this use case will come up a lot when building tiny web apps.The text was updated successfully, but these errors were encountered: