2017-08-30 82 views
2

,而我试图编译运行的代码构建定制terraform提供程序错误出

[[email protected] 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) 

[[email protected] Netapp]# go version 
go version go1.8.3 linux/amd64 

有人可以帮助我了解什么是错在这里我打这个错误?

在此先感谢!

+4

如果您使用go <1.9(请参阅[开发Terraform](https://github.com/hashicorp/terraform#developing-terraform)) – fernandezcuesta

+0

请参阅https://golang.org/doc/go1。 9#测试辅助 – JimB

回答

1

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

由于提供程序依赖于核心系统中的某些程序包作为库,所以这种依赖关系很可惜也由提供程序继承。如果您使用自助服务向提供商提供Terraform内核(推荐!),那么您可以将自动售货版本退回至the final commit before this change,以便使用1.8版本构建,但随着时间的推移,该策略当然会导致出售套餐落后于最新的变化。

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