go-bindata 类似,esc 同样提供了将静态文件转换为go源码并暴露了类似于http.FileSystem的API来读取数据的功能。

安装

  1. go get -u github.com/mjibson/esc

使用

https://github.com/mjibson/esc#example

对比:

go-bindata、go.rice 和 esc 简单对比:https://studygolang.com/articles/5068
esc没有 go-bindata 那样丰富的API,但会将嵌入的字节数据压缩,大大缩小了代码以及编译后的二进制程序体积。