dssqq82402 2016-04-28 10:57
浏览 57

部署到Elastic Beanstalk时如何安装Go依赖项?

I have an application that's split across a few different files and I'm having trouble deploying it. I've followed this documentation, but I'm getting the following:

application.go:7:5: cannot find package "github.com/gorilla/handlers" in any of:

I assume I need to install the libraries I'm using in the $GOPATH as part of the deployment process, but I don't know how to do that and haven't found any examples of it. Using the Procfile seems promising, but all of my searches keep leading me to Heroku resources.

  • 写回答

3条回答 默认 最新

  • doulouli8686 2016-04-28 11:40
    关注

    You could use a vendoring tool to store all your dependencies within a vendor folder.

    I use govendor.

    Steps:
     1. go get -u github.com/kardianos/govendor
     2. cd $GOPATH/yourProject
     3. govendor init
     4. govendor add +external
    

    Now the directory 'yourProject' can be build independently on any machine provided it is in $GOPATH.

    Note : Requires Go 1.6+ or 1.5 with GO15VENDOREXPERIMENT=1.

    Edit : As per fl0cke's comment. If Elastic Beanstalk only supports Go 1.4, the possible options are :

    评论

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助