The features are:
- Files are read-only.
- Used in front-end code via GopherJS, or local Go program.
- Can be included in your Go package, or put in a separate package.
The idea of goef is simple. Encode the content of the files in Base64 format and put the (name, content) of the files in the (key, value) of Go built-in map structure. Then implement a ReadFile method which has the same usage as ioutil.ReadFile in Go standard library.
For usage details, please visit GitHub repo.
Tested on: Ubuntu Linux 17.10, Go 1.10.2.
|||GitHub - siongui/goef: Embed file in your Go code|