Right now
golang.org/x/build/devapp includes two HTML files by loading them from disk at runtime, meaning you have to start the binary from the correct directory and ensure that the HTML files are present on disk.
func showDash(w http.ResponseWriter, req *http.Request) {
// ...
tmpl, err := ioutil.ReadFile("template/dash.html")
if err != nil {
log.Errorf(ctx, "reading template: %v", err)
return
}
t, err := template.New("main").Funcs(template.FuncMap{
"css": d.css,
I'd like to compile these into the binary, so deployment is simpler.
I could port that, but there is a 3rd party tool for embedding static files in a binary -
github.com/jteeuwen/go-bindata - that would 1) compress the contents of assets before storing them, doesn't require manual management of the file list, and 2) remove the need for the go:generate directive and BOM hacking code in makestatic.go.
- What are your thoughts on using that tool in both places?
- If "let's use it" what is the policy for including 3rd party libraries in golang tools? OK as long as the author signs a CLA & library is available under a permissive license?
- If "let's not use it", is there another tool I'm missing where static files are compiled into a binary?
- Is this the best place to get feedback while I'm working on improvements to
dev.golang.org? Alternatives would be emailing someone directly who'd be reviewing patches, just submitting the patches, posting on Github, or posting to a different mailing list.