英文:
run go script after compile android
问题
Go似乎是Android中得到很好支持的脚本语言。然而,从文档中可以明确看出,谷歌希望在编译之前将所有的Go脚本包含在Android项目中。有没有办法避免这样做呢?
我能否在编译后运行一个脚本?比如从后端服务器下载一个脚本然后直接运行它?
英文:
Go seems to be a well supported scripting language in Android. However, from the documentation it is clear that google wants you to include all go scripts in your Android project before compilation. Is there a way to avoid this?
Could I run a script created after compilation? Like downloading a script from a backend server and just run it?
答案1
得分: 2
Go需要像C库一样进行链接。Go是一种编译语言,而不是脚本语言。根据你的建议,你需要下载并执行一个基本上是任意的可执行文件,据我所知,这是不被支持的。
一个可能的方法是下载并动态链接你创建的Go库。然而,我不确定是否真的可以实现这一点。
英文:
Go needs to be linked in the same manor as a C library would be. Go is also a compiled language, not a scripting language. To do as you suggest you would need to be downloading and executing an essentially arbitrary executable which as far as I am aware is not supported.
One possible avenue, would be downloading and dynamically linking the Go library you create. However I am not sure if that is actually achievable.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论