【问题标题】:Building a custom terraform provider errors out构建自定义 terraform 提供程序错误
【发布时间】:2017-09-01 06:42:28
【问题描述】:

我在尝试编译 GO 代码时遇到了这个错误

[root@scsor0014444001 Netapp]# go build -o terraform-provider-xxxx
# github.com/hashicorp/terraform/config
../go/src/github.com/hashicorp/terraform/config/testing.go:9: t.Helper undefined (type *testing.T has no field or method Helper)

[root@scsor0014444001 Netapp]# go version
go version go1.8.3 linux/amd64

有人可以帮我理解这里有什么问题吗?

提前致谢!

【问题讨论】:

标签: go terraform


【解决方案1】:

从 0.10.3 版本开始,由于使用了新的“测试助手”功能,Terraform 核心现在需要 Go 1.9。

由于提供者依赖于核心系统中的一些包作为库,不幸的是,这种依赖关系也被提供者继承了。如果您使用 vendoring 使 Terraform 核心可供供应商使用(推荐!),那么您可以将已售出的版本回退到 the final commit before this change 以便使用 1.8 构建,尽管随着时间的推移,这个策略当然会导致供应商的软件包落后于最新的更改。

升级到 1.9 应该以更永久的方式解决这个问题。

【讨论】:

    猜你喜欢
    • 2021-03-14
    • 2020-07-08
    • 1970-01-01
    • 2020-06-12
    • 1970-01-01
    • 1970-01-01
    • 2019-11-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多