dpfln86244 2015-01-05 12:59
浏览 125
已采纳

转到:将bash脚本嵌入二进制文件

I'm trying to cross compile a Go program that will execute a bash script. Is it possible to embed the bash script in the binary?

I've referenced: Golang serve static files from memory

Not sure if this applies to executing bash scripts though. Am I missing something here? Some clarification or pointers will be very helpful, thanks!

  • 写回答

4条回答 默认 最新

  • duanhe6464 2015-01-05 20:21
    关注

    Yes, you can include any files in your binary with go-bindata: https://github.com/jteeuwen/go-bindata

    I've also made a tool for making Go/Bash hybrid apps: https://github.com/progrium/go-basher

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Python题,回答一下下啦
  • ¥15 会会信号与系统和python的来
  • ¥15 关于#python#的问题
  • ¥20 oracle RAC 怎么配置啊,配置
  • ¥15 excel 日常使用中出现问题
  • ¥20 pdusession建立失败
  • ¥15 为什么mqtt接收不到数据?
  • ¥15 思科校园网的组建,sos!
  • ¥15 主要进行描述非满管状态下,管路的摩阻系数是怎么变化的,在管路长度方向上是怎么分布的(标签-matlab)
  • ¥15 multisim设计求解如图