hashicorp / terraform-config-inspect

A helper library for shallow inspection of Terraform configurations
Mozilla Public License 2.0
383 stars 76 forks source link

Failed to get modules #36

Open mangokingTW opened 4 years ago

mangokingTW commented 4 years ago
$ go get github.com/hashicorp/terraform-config-inspect
package github.com/hashicorp/hcl/v2: cannot find package "github.com/hashicorp/hcl/v2" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/v2 (from $GOROOT)
package github.com/hashicorp/hcl/v2/gohcl: cannot find package "github.com/hashicorp/hcl/v2/gohcl" in any of:              /usr/local/go/src/github.com/hashicorp/hcl/v2/gohcl (from $GOROOT)
package github.com/hashicorp/hcl/v2/hclparse: cannot find package "github.com/hashicorp/hcl/v2/hclparse" in any of:        /usr/local/go/src/github.com/hashicorp/hcl/v2/hclparse (from $GOROOT)
package github.com/hashicorp/hcl/v2/hclsyntax: cannot find package "github.com/hashicorp/hcl/v2/hclsyntax" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOROOT)

I see the lastest commit updated the module to hcl/v2. But I didn't see it in github.com/hashicorp/hcl

kiranjthomas commented 4 years ago

Posting this in case anyone else needed to be temporarily unblocked. I forked the repo and reverted the last commit here: https://github.com/kiranjthomas/terraform-config-inspect

jstewmon commented 4 years ago

To go get in module mode when there is no go.mod file in the current directory, you have to explicitly run go get in module-aware mode by setting GO111MODULE=on - e.g.GO111MODULE=on go get github.com/hashicorp/terraform-config-inspect

https://golang.org/cmd/go/#hdr-Module_support

hornetmadness commented 4 years ago

Posting this in case anyone else needed to be temporarily unblocked. I forked the repo and reverted the last commit here: https://github.com/kiranjthomas/terraform-config-inspect

This worked like a charm.

sblack4 commented 4 years ago

Posting this in case anyone else needed to be temporarily unblocked. I forked the repo and reverted the last commit here: https://github.com/kiranjthomas/terraform-config-inspect

Thank you! Running the below allowed me to run terraform-config-inspect 😄

go get github.com/kiranjthomas/terraform-config-inspect
osterman commented 3 years ago

Relates to #57