douhe3313 2015-12-30 09:17
浏览 75
已采纳

我的Godeps.json是否正确生成?

I am trying to deploy a simple go lang server on heroku.I have managed to get it running. But I am wondering if my utilisation of godep is proper.

Here is the Godeps.json I have produced.

{
    "ImportPath": ".",
    "GoVersion": "go1.5",
    "Packages": [
        "./..."
    ],
    "Deps": [
        {
            "ImportPath": "github.com/kevinlg/trendee-api",
            "Rev": "6acde53081a273d4caedf113688e1ab83854c877"
        }
    ]
}

I am wondering why "ImportPath":"." and not github.com/kevinlg/trendee-api instead of having it as a dependency ?

When I check the Heroku example or the Godeps.json for godep I can see

"ImportPath": "github.com/heroku/go-getting-started",

or

"ImportPath": "github.com/tools/godep

I have been able to get the server running and deployed on heroku.

Here is my project folder structure

trendee-api /(GOPATH)
   bin/
   Godeps/
   pkg/
   src/
     github.com/
      kevinlg/
        trendee-api/

I have used the following commands.

godep save -r ./...
go install github.com/kevinlg/trendee-api

Thanks in advance for the help

  • 写回答

2条回答 默认 最新

  • duanreng3439 2015-12-30 20:09
    关注

    When you use godep save -r ./... you are saving multiple packages, which is why your Godeps.json looks like that.

    For a single binary, you could also use godep save -r in the $GOPATH/src/github.com/kevinlg/trendee-api directory, given the following structure:

    trendee-api /(GOPATH) bin/ Godeps/ pkg/ src/ github.com/ kevinlg/ trendee-api/ main.go

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

报告相同问题?

悬赏问题

  • ¥15 asp.textbox后台赋值前端不能显示什么原因
  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误