terratest: modules/terraform/var-file.go:142:8: undefined: hcl.Decode
Latest release is causing an error:
vendor/github.com/gruntwork-io/terratest/modules/terraform/var-file.go:142:8: undefined: hcl.Decode
FAIL git.*******.com/mongodbatlas-tf/terratest/mongodbatlas-cluster [build failed]
FAIL
Exited with code exit status 2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 16 (6 by maintainers)
I think the root of the issue is dep is trying to pull v2 of hcl while the go mod of the terratest library explicitly referenes v1, so dep isnt respecting the libraries required version
As WafflesMcDuff mentioned, use
go mod initinstead of
dep initI was able to fix my new issue with
GO111MODULE=onas per https://github.com/hashicorp/hcl/issues/371 so your update to terratest resolved my problems. Thank you.This is indeed a bug as we should be using hclv2. Will work on updating the library function to use hcl v2 asap.
Apparently this version breaks compatibility with go dep. Had to switch from
dep init && dep ensure -vendor-onlytogo mod init git.rockfin.com/mongodbtatlas-tf && go mod vendor