英文:
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(
"mysite.com/libraries/mylib1"
)
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论