duan02468 2016-07-05 21:53
浏览 80

进行组件开发的依赖管理

I am new to go. I am working on a go project that cannot be in a single git repository. The exact case is that I have to make public a library I am developing and I at the same time have a private project that depends on it. I would assume that there are many other scenarios that such need could arise.

It seems the existing go dependency management is designed around the concept that components or other 3rd party dependencies will be moving in significant well-defined steps with switching to different repo locations.

In my case, I would like to grow my public and my private part of the code together, where I would like to have a setup that allows having a significant number of breaking changes. Where I can submit in my public library without breaking the build of the existing private project. And later moving my private dependent project to such version with the according fixes.

Creating different repo address for almost every change in my public library to achieve this seems overkill and expensive to do.

Any advice?

  • 写回答

1条回答 默认 最新

  • dsx666666 2016-07-05 23:39
    关注

    Since 1.5 Go has built in support for vendoring (enabled by default since 1.6).

    Your best bet is vendoring your packages as git submodules under the vendor/ folder in your private package and manually upgrading them.

    There are a lot of tools that simplifies that, I've personally used manul which is rather simple.

    https://github.com/golang/go/wiki/PackageManagementTools is a good read.

    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制