Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> With Go you need a directory structure to store your templates, CSS, etc.

Is there anything stopping one from appending a zip archive to the go binary, and having the binary open the executable as a zip file to get at the static assets ?



There are some 3rd party build tools to help with that. Below are a couple I found.

https://github.com/GeertJohan/go.rice

https://github.com/jteeuwen/go-bindata

EDIT: to add, the Go team is looking to add a generate command in go1.4 to help with this. See: https://groups.google.com/forum/m/#!topic/golang-dev/ZTD1qtp...


go.rice (https://github.com/GeertJohan/go.rice) does things like this.


Thanks guys I was looking for something like that and I was aware of go-data, this with the next go generate should be very neat!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: