Closed yermulnik closed 4 years ago
@yermulnik Thank you for reporting the problem.
It seems to have failed to get github.com/hashicorp/hcl/v2
I'm not sure go get
fails if the dependent library is v2 module.
Can you try the following?
$ git clone https://github.com/minamijoyo/tfupdate
$ cd tfupdate/
$ make install
$ tfupdate --version
Makefile
approach worked:
> tfupdate --version
0.3.0
Thanks. Though I think need to amend/fix straight go get …
approach.
Thank you for checknig it.
When I had started writing the code, the hcl2 library had been in hashicorp/hcl2 repository, and afterward it moved to the hcl2 branch in the hashicorp/hcl.
https://github.com/hashicorp/hcl2/issues/115
The hcl2 branch has not been merged into master yet, but released as v2.0.0 tag.
https://github.com/hashicorp/hcl/releases/tag/v2.0.0
So I switched the dependency from hashicorp/hcl2@master to hashicorp/hcl@hcl2.
https://github.com/minamijoyo/tfupdate/commit/e2161f596eba69e70388263a8cfca43b1e8805f8
The Go module treats v2 tag as special meanings.
https://blog.golang.org/v2-go-modules
The master branch in hashicorp/hcl has go.mod, but it is a v1 module.
https://github.com/hashicorp/hcl/blob/914dc3f8dd7c463188c73fc47e9ced82a6e421ca/go.mod
So, If my understanding is correct, I think this problem will be resolved when the hcl2 branch in hashicorp/hcl is merged into master. I don't know if this is a go get
issue or a specification.
Maybe related to this? https://github.com/golang/go/issues/35630
As a workaround, we should check out the code before building. We will probably need to fix the instruction in README.
Please let me know if my understanding is wrong. Thanks!
Thanks for clarifications. My own issue was already fixed with Makefile
approach =)
@yermulnik I've fixed the instruction in README. #6 Thank you for reporting this!
Anything I'm missing?