Uploading local library to go get

blov · · 13 次点击    
<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>
13 次点击  
加入收藏 微博
0 回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传