How to contribute to a golang project: question about imports

blov · · 1545 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello, i want to contribute to a golang project on github, so i forked it.</p> <p>If it has owner&#39;s repo references like &#34;johnsmith/foopack&#34; that are inside the project, i have obviously change them to &#34;myuser/foopack&#34;.</p> <p>How do you handle this when you do a pull request? I don&#39;t want to change back every reference.</p> <hr/>**评论:**<br/><br/>pdffs: <pre><p>Clone (or <code>go get</code>) the original repo, fork it, then add your remote to the repo:</p> <pre><code>git remote add youruser https://github.com/youruser/originalrepo.git </code></pre> <p>Now you can push to your fork like:</p> <pre><code>git push youruser branchname </code></pre> <p>And your local copy retains the original import path(s)</p></pre>SeerUD: <pre><p>Fork it, clone your fork to where the existing package naming would put it in your GOPATH. You don&#39;t have to change the package names.</p></pre>8lall0: <pre><p>That&#39;s a good idea, thank you.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

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