Golang导入;go get mywebsite.com/mylibrary/function

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

Golang import; go get mywebsite.com/mylibrary/function

问题

以下是翻译好的内容:

我的一些工作代码不适合公开,所以我想在公司的服务器上运行。使用"go get"从私有服务器检索库的最简单方法是什么?
在Apache网站上拥有库的最简单方法是什么?

以下是我想要做的事情。

获取我的代码

go get mysite.com/libraries/mylib1

源代码

package main
import(
    "mysite.com/libraries/mylib1"
)

func main() {
    mylib1.Print()
}

谢谢!

英文:

Some of my code written for work is not suitable for public. So, I like to run within company's server. What would be the easiest way to retreat the library using "go get" from a private server.
<strike>What would be easiest way to have library on Apache website? </strike>

Below are what I'd like to do.

Get my code
> go get mysite.com/libraries/mylib1

Source

package main
import(
    &quot;mysite.com/libraries/mylib1&quot;
)

func main() {
    mylib1.Print()
}

Thank you!

答案1

得分: 2

我遇到了同样的问题,我们所做的是搭建了自己的GitLab服务器来存放所有的库和代码。

英文:

I had the same problem what we did was just spin up our own GitLab server to hold all of the libraries/code.

答案2

得分: 0

只需将代码放在$GOPATH/src/mysite.com/project中即可。

最简单的方法是使用自己的Git服务器。

英文:

just have the code in $GOPATH/src/mysite.com/project

easiest would be an own git server.

huangapple
  • 本文由 发表于 2016年2月10日 04:23:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/35301459.html
匿名

发表评论

匿名网友

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

确定