构建自定义的terraform提供程序错误

时间:2017-08-30 09:52:25

标签: go terraform

我在尝试编译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

有人可以帮我理解这里的错误吗?

提前致谢!

1 个答案:

答案 0 :(得分:1)

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

由于提供程序依赖于核心系统中的某些软件包作为库,因此不幸的是,这种依赖关系也会被提供者继承。如果您正在使用 vendoring 使Terraform核心可供提供商使用(推荐!),那么您可以将销售版本转回the final commit before this change以便使用1.8进行构建,但随着时间的推移这种策略当然会导致销售套餐落后于最新的变化。

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