dtsnx44260 2018-08-26 09:36
浏览 63

由于第三方代码位于供应商中而导致dep导致类型问题

I have my project in which I use go dep to import the Gobot package. When trying to build however, I get this:

cannot use r (type *raspi.Adaptor) as type "github.com/lucavallin/hytta-agent/vendor/gobot.io/x/gobot/drivers/i2c".Connector in argument to "github.com/lucavallin/hytta-agent/vendor/gobot.io/x/gobot/drivers/i2c".NewGrovePiDriver:
    *raspi.Adaptor does not implement "github.com/lucavallin/hytta-agent/vendor/gobot.io/x/gobot/drivers/i2c".Connector (wrong type for GetConnection method)
        have GetConnection(int, int) ("gobot.io/x/gobot/drivers/i2c".Connection, error)
        want GetConnection(int, int) ("github.com/lucavallin/hytta-agent/vendor/gobot.io/x/gobot/drivers/i2c".Connection, error)

The types are ok and the example is provided by the people behind Gobot, but it seems go is not happy because it's expecting an object coming from the "absolute repo" instead of my vendor directory.

Any idea how I can fix this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法