gpt4 book ai didi

go - 构建自定义 Terraform 提供程序出错

转载 作者:IT王子 更新时间:2023-10-29 01:44:37 25 4
gpt4 key购买 nike

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

有人可以帮助我了解这里出了什么问题吗?

提前致谢!

最佳答案

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

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

将 Go 升级到 1.9 应该可以更永久地解决这个问题。

关于go - 构建自定义 Terraform 提供程序出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45957208/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com