我无法从GitHub上获取一个依赖项。

huangapple go评论165阅读模式
英文:

I can't "go get" a dependency from github

问题

我在我的机器上制作了一个使用cron的golang应用程序。在我的机器上,我使用"go get github.com/robfig/cron"来下载和安装依赖项,然后在我的应用程序中使用"import cron "github.com/rk/go-cron""。应用程序运行良好,按照我想要的方式运行。然后,我将其上传到服务器上,希望它能运行,并尝试像在我的机器上那样"go get github.com/robfig/cron",但是然后它给了我这个错误。我已经下载并安装了github,但结果仍然相同。我猜问题出在我的服务器机器上。我对golang还不熟悉,任何帮助将不胜感激。谢谢。

英文:

I made a golang app on my machine that uses cron. On my machine, I

"go get github.com/robfig/cron"

to download and install dependency then in my app I

"import cron "github.com/rk/go-cron""

the app works fine and runs the way I want. I then upload it to the server where it's supposed to run and try to "go get github.com/robfig/cron" as I did on my machine, but then it gave me this

我无法从GitHub上获取一个依赖项。

I downloaded and installed github but still the same result. I'm guessing the problem is with github on my server machine

I am new to golang and andy kind of help would be greatly appreciated. Thanks.

答案1

得分: 3

你需要安装的是git。它是GitHub使用的版本控制系统(VCS)。
原生的GitHub应用程序不提供Go使用的命令行工具。

可以在http://git-scm.com/downloads找到并下载Git。

安装完成后,确保在你的%PATH%环境变量中有Git cmd文件夹的路径。
你可以通过运行命令echo %PATH%来检查这一点。

在Windows安装中,你可能会在这里找到它:

C:\Program Files (x86)\Git\cmd

英文:

What you need to install is git. It is the version control system (VCS) used by GitHub.
The native GitHub application does not provide the command line tools used by Go.

Git can be found and downloaded at http://git-scm.com/downloads

Once installed, make sure you have the path to the Git cmd folder in your %PATH% environment variable.
You can check this by running the command: echo %PATH%

On a Windows installation, you might find it located here:
>C:\Program Files (x86)\Git\cmd

huangapple
  • 本文由 发表于 2013年9月19日 14:49:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/18887933.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定