本文介绍了如何将文件嵌入Golang二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些从Go程序中读取的文本文件.我想发布一个可执行文件,而无需另外提供该文本文件.如何将其嵌入Windows和Linux上的编译中?
I have some text file that I read from my Go program. I'd like to ship a single executable, without supplying that text file additionally.How do I embed it into compilation on Windows and Linux?
推荐答案
使用 go-bindata .在自述文件中:
这篇关于如何将文件嵌入Golang二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!