hashicorp / terraform-config-inspect

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

unable to install #51

Open ryanking opened 4 years ago

ryanking commented 4 years ago

Maybe I am doing something wrong, but the instructions from the README do not work for installing this library.

 $ go get github.com/hashicorp/terraform-config-inspect
cannot find package "github.com/hashicorp/hcl/v2" in any of:
    /usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2 (from $GOROOT)
    /Users/rking/go/src/github.com/hashicorp/hcl/v2 (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/gohcl" in any of:
    /usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/gohcl (from $GOROOT)
    /Users/rking/go/src/github.com/hashicorp/hcl/v2/gohcl (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/hclparse" in any of:
    /usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/hclparse (from $GOROOT)
    /Users/rking/go/src/github.com/hashicorp/hcl/v2/hclparse (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/hclsyntax" in any of:
    /usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOROOT)
    /Users/rking/go/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOPATH)
sdib commented 3 years ago

Maybe you're using Go in GOPATH mode. Can you try to :

  1. export GO111MODULE="on"
  2. go get github.com/hashicorp/terraform-config-inspect
osterman commented 3 years ago

Relates to #57

eballetbaz commented 2 years ago

Hi, I had the same issue on Windows and this solved the problemfor me:

set GO111MODULE=on
go get github.com/hashicorp/terraform-config-inspect

But for sure I will appreciate having pre-built binaries too.