Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将静态文件打包到二进制中 #169

Closed
WangLeonard opened this issue Jul 27, 2020 · 2 comments
Closed

将静态文件打包到二进制中 #169

WangLeonard opened this issue Jul 27, 2020 · 2 comments

Comments

@WangLeonard
Copy link
Member

当前serve端构建二进制后,仍需要拷贝config.yamlresource/...资源到机器中才可以执行
我试验了https://github.com/go-bindata/go-bindata 这个仓库所实现的功能

应该可以实现该功能,并做到对原有功能没有影响
需要在core _ import 实现该功能的包
可能需要在main.go中增加一条//go:generate go-bindata XXX(应该也可以放到该功能所新增的go文件中)
在需要该功能时,编译二进制前 需要go get 上面的仓库,执行 go:generate 命令,
然后go build -tags=XXX 即可使用

计划如果使用该功能后,为了与现有方式最大兼容,在程序启动时,将所需文件从内存写入到对应的位置,继续运行程序

@piexlmax gva有这方面的需要吗? 有需要的话我可以继续实现下,后续提交PR

@WangLeonard
Copy link
Member Author

#170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@WangLeonard and others