doudi1978 2018-12-18 16:08
浏览 38

如何在dep中使用本地src覆盖供应商软件包(用于本地开发)

Pseudo project setup:

  • $GOPATH/src/github.com/foo/common-libs
  • $GOPATH/src/github.com/foo/my-project (has a dependency on common-libs managed by dep, copy in /vendor directory

Can't find a way to edit common-libs locally (i.e. in /src) and have those changes immediately reflected in my-project. The project /vendor file always has priority over that in $GOPATH.

Instead every time I need to push the common-libs changes to Github then run dep ensure -update in my-project -- which is really slow and annoying.

Tried (unsuccessfully):

  1. Ignoring local /vendor in Gopkg.toml using ignored = ["github.com/foo/common-libs*"], but throws a compilation error: cannot use &amount (type *"github.com/foo/my-project/vendor/github.com/shopspring/decimal".Decimal) as type *"github.com/foo/common-libs/vendor/github.com/shopspring/decimal".Decimal in field value)
  2. Manually deleting common-libs from the /vendor directory of my-project (temporarily) -- but this leads to the same compilation error as #1 (and is annoying because running dep ensure adds the deleted folder back to the vendor folder).
  3. Manually editing common-libs in /vendor (temporarily), which works -- but I lose static code analysis and I have to copy the changes to the actual common-libs projects afterwards.

Any help appreciated! Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line