dineshba / tf-summarize

A command-line utility to print the summary of the terraform plan
MIT License
534 stars 38 forks source link

Enable Go Install #21

Closed triarius closed 1 year ago

triarius commented 1 year ago

Hi @dineshba this is a cool tool that I would like to use more of.

I think it would help a few people a lot if they would install this with the go install command: https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies

Unfortunately, right now when I try to do that, this happens:

🕙 12:40:08 ❯ go install github.com/dineshba/tf-summarize@latest
go: github.com/dineshba/tf-summarize@latest: github.com/dineshba/tf-summarize@v0.2.5: parsing go.mod:
    module declares its path as: terraform-plan-summary
            but was required as: github.com/dineshba/tf-summarize

I believe that to fix it, you need the name of the package module to match the address of the repository, so I made this PR.

I also tested it on my fork:

🕙 12:47:48 ❯ tf-summarize
fish: Unknown command: tf-summarize
~
🕙 12:47:56 ❯ go install github.com/triarius/tf-summarize@latest
🕙 12:48:03 ❯ tf-summarize -help
Usage of tf-summarize [args] [tf-plan.json|tfplan]

  -draw
        [Optional, used only with -tree or -separate-tree] draw trees instead of plain tree
  -json
        [Optional] print changes in json format
  -md
        [Optional, used only with table view] output table as markdown
  -out string
        [Optional] write output to file
  -separate-tree
        [Optional] print changes in tree format for add/delete/change/recreate changes
  -tree
        [Optional] print changes in tree format
  -v    print version

I don't think it should interfere with your CI, but if it does, I'll be happy to work with you to fix it.