Vendoring own code thoughts

blov · · 434 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>My web MVC project (not a framework) on <a href="https://github.com/josephspurrier/gowebapp" rel="nofollow">Github</a> has been forked a few times and some of the users had to rename many of the imports to match their own repository once they forked the code. This also led to issues where they would forget to change the import paths and they would submit issues that were not really issues.</p> <p>I know vendoring is now enabled by default in Go 1.6 so I decided to create a folder inside <strong>vendor</strong> called <strong>app</strong> and then move the majority of the Go code to that folder.</p> <p>This allows other users to fork my code and have it compile without making any code changes. The import paths are also shorter (not a big deal) and the code is now more portable. I didn&#39;t want to use relative import paths because I read it wasn&#39;t a good practice.</p> <p>I haven&#39;t worked a lot with vendoring so for those that are familiar with current vendoring tools and practices, do you see any issues with vendoring the core code? Whether it&#39;s technical issues or reasoning against this, I&#39;d like to hear it. Thanks guys!</p> <p>TL;DR: Any problems with storing the majority of my core code inside the <strong>vendor</strong> folder?</p> <hr/>**评论:**<br/><br/>dontwantanaccounttt: <pre><p>Basically, your project should be a library. Whatever code you can move into vendor, should be that library.</p></pre>zacheryph: <pre><p>Lib or create some sort of generator. </p></pre>

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

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