2017-08-30 81 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應該以更持久的方式解決這個問題。