go 1.16版本开始,支持将静态资源文件打包至二进制文件啦~,在1.16版本之前,开源界提供了很多方案,终于在此版本官方提供了统一的解决方案。具体使用见官方文档:https://pkg.go.dev/embed
import _ "embed"
//go:embed hello.txt
var s string
print(s)
复制代码
Related Issues not found
Please contact @imyzt to initialize the comment