cycloidio / terracost

Cloud cost estimation for Terraform in your CLI
MIT License
278 stars 29 forks source link

Cannot install terracost with go 1.18 #74

Closed trinitronx closed 1 year ago

trinitronx commented 2 years ago

Steps to Reproduce:

go.mod file contains:

replace github.com/hashicorp/terraform => github.com/hashicorp/terraform v0.15.3

Expected result:

Installation of terracost should work on Go >= 1.16

GO111MODULE=off Workaround fails on missing hashicorp/terraform/configs:

xlr-8 commented 2 years ago

Could you confirm https://github.com/cycloidio/terracost/pull/75/ is fixing your problem?

mareq commented 1 year ago

I am not super-familiar with golang, so not sure if I am doing something wrong, but I seem to have the same problem:

$ go get github.com/cycloidio/terracost@ff0b0053
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
$ go install github.com/cycloidio/terracost@ff0b0053
go: downloading github.com/cycloidio/terracost v0.5.1-0.20220513154206-ff0b0053cde6
go: downloading github.com/spf13/afero v1.6.0
go: downloading github.com/hashicorp/hcl/v2 v2.10.1
go: downloading github.com/machinebox/progress v0.2.0
go: downloading google.golang.org/api v0.60.0
go: downloading github.com/mitchellh/mapstructure v1.4.2
go: downloading golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9
go: downloading golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
go: downloading golang.org/x/mod v0.5.1
go: downloading golang.org/x/sys v0.0.0-20211124211545-fe61309f8881
go: downloading google.golang.org/grpc v1.42.0
go: downloading google.golang.org/protobuf v1.27.1
package github.com/cycloidio/terracost is not a main package
$ go version
go version go1.19.3 linux/amd64