首页 > 解决方案 > 更新 azure-sdk-for-go 库依赖项

问题描述

执行此任务的最佳做法是什么?

到目前为止我尝试了什么,只需运行dep ensure -update github.com/Azure/azure-sdk-for-go 引发以下错误的命令:

    Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/gravitational/trace
  .....

dep ensuredep -update给了我与命令类似的错误。dep check给出以下输出:

# Gopkg.lock is out of sync:
github.com/Azure/azure-sdk-for-go/arm/compute: imported or required, but missing from Gopkg.lock's input-imports
.....

# vendor is out of sync:
cloud.google.com/go: no digest in Gopkg.lock to compare against hash of vendored tree
github.com/Azure/azure-sdk-for-go: no digest in Gopkg.lock to compare against hash of vendored tree
....

这是一个相当大的项目。我应该手动将代码中的所有现有依赖项删除到旧的import azure-sdk-for-go吗?或者应该deb能够执行这个任务?我尝试了各种技巧来使其正常工作,例如手动修改Gopk.lock文件,删除azure-sdk-for-go文件夹中的vendor文件夹,但到目前为止我没有运气。对此的任何帮助将不胜感激。

标签: azuregodep

解决方案


看起来您是从一个相当旧的版本更新的,因为github.com/Azure/azure-sdk-for-go/arm/compute在此 SDK 仍处于预览阶段时,已在大约一年前被弃用和删除。

要继续前进,您应该将计算路径更新为github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute. 从那时起,还将采用其他几项重大更改。


推荐阅读