<p>Hey there! So, I started Go a month a go, came from C++. One thing that I found pretty nice is the go get command to install a library. How can I upload my library to get it from this command? I know how to do it locally, writing it in my GOPATH. </p>
<hr/>**评论:**<br/><br/>sh41: <pre><p>As someone who also came from C++, I agree, <code>go get</code> is one of my favorite features of Go too.</p>
<p>If you have your Go package hosted on a code host like GitHub or another one, you should be able to use <code>go get</code> on it.</p>
<p>The following document describes the process of writing some Go code to make Go packages, and then making it available for <code>go get</code>:</p>
<p><a href="https://golang.org/doc/code.html" rel="nofollow">https://golang.org/doc/code.html</a></p>
<p>It describes the whole process from start to finish. This section is most relevant to what you’re asking:</p>
<p><a href="https://golang.org/doc/code.html#Library" rel="nofollow">https://golang.org/doc/code.html#Library</a></p>
<p>There’s also a screencast version mentioned in the introduction.</p>
<p>If you want more of a reference on how <code>go get</code> resolved import paths, see <a href="https://golang.org/cmd/go/#hdr-Remote_import_paths" rel="nofollow">https://golang.org/cmd/go/#hdr-Remote_import_paths</a>.</p>
<p>I hope you enjoy!</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传