-
Notifications
You must be signed in to change notification settings - Fork 116
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
assetFS is not exportable #45
Comments
I'm doing the same. Don't see why assetFS is not exported... |
it's not so bad. you can export it from the same file you generate it: //go:generate go-bindata-assetfs -pkg swagger swagger/...
package swagger
import assetfs "github.com/elazarl/go-bindata-assetfs"
func AssetFS() *assetfs.AssetFS {
return assetFS()
} then serve it from your package webServer.Handle("/swagger/", http.FileServer(swagger.AssetFS())) the actual fileserver doesn't seem to work for me though :/ edit: fixed it. serve one folder of the same name. could probably use -prefix as well webServer.Handle("/swagger/", http.StripPrefix("/swagger/", http.FileServer(swagger.AssetFS()))) |
Whats the status on this issue? |
joegasewicz
added a commit
to ONSdigital/go-bindata-assetfs
that referenced
this issue
Apr 12, 2022
joegasewicz
added a commit
to ONSdigital/go-bindata-assetfs
that referenced
this issue
Apr 12, 2022
joegasewicz
added a commit
to ONSdigital/go-bindata-assetfs
that referenced
this issue
Apr 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
assetFS is not exportable. so i do :
go-bindata-assetfs -pkg res resources/..
then in generated bindata_assetfs.go i changing assetFS to AssetFS and using it like
import {...
"bindata_assetfs"
}
http.Handle("/resources", http.FileServer(res.AssetFS()))
The text was updated successfully, but these errors were encountered: