You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
I want to declare multiple files when using the go-bindata-assetfs cmd:
$ go-bindata-assetfs dist/... public/...
OR I want to only specify the dist directory:
$ go-bindata-assetfs dist/...
But because the dist directory has a public directory sibling, the assetFS() will randomly pick either the dist or public directory to generate from.
Issue:
The call to assetFS() will randomly pass back only the first item in the _bintree.Children slices, which means that if I pass a top level directory with multiple children directories assetFS() will not return the desired results.
Requested changes:
I want to be able to define each static path to serve manually, either multiple of a single child directory. This example demonstrates serving 2 static directories but even if i just want to serve a single directory assetFS() will not work if there are more than 1 directories present:
func main() {
r := mux.NewRouter() // Example uses "github.com/gorilla/mux"
// Here we want to serve static content from 2 directories
r.PathPrefix("/dist").Handler(http.StripPrefix("/dist", http.FileServer(AssetDIR("dist"))))
r.PathPrefix("/public").Handler(http.StripPrefix("/public", http.FileServer(AssetDIR("public"))))
// rest of server code...
server := &http.Server{ Addr: ":7777", Handler: r, }
server.ListenAndServe()
}
The text was updated successfully, but these errors were encountered:
joegasewicz
added a commit
to ONSdigital/go-bindata-assetfs
that referenced
this issue
Apr 12, 2022
joegasewicz
changed the title
Cannot declare multiple directories with go-bindata-assetfs
Cannot declare multiple directories with go-bindata-assetfs or a single child.
Apr 13, 2022
Problem:
I want to declare multiple files when using the
go-bindata-assetfs
cmd:OR I want to only specify the
dist
directory:But because the
dist
directory has apublic
directory sibling, theassetFS()
will randomly pick either thedist
orpublic
directory to generate from.Issue:
The call to
assetFS()
will randomly pass back only the first item in the_bintree.Children
slices, which means that if I pass a top level directory with multiple children directoriesassetFS()
will not return the desired results.Requested changes:
I want to be able to define each static path to serve manually, either multiple of a single child directory. This example demonstrates serving 2 static directories but even if i just want to serve a single directory
assetFS()
will not work if there are more than 1 directories present:The text was updated successfully, but these errors were encountered: