Skip to content

Commit

Permalink
changed input from file path to io.Reader
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed May 17, 2023
1 parent 672f04d commit 50a35d0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions external/states/statefile/resources.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package statefile

import (
"io"
"sort"

"github.com/kaytu-io/terraform-package/external/addrs"
"github.com/kaytu-io/terraform-package/external/configs/hcl2shim"
"os"
"sort"

ctyjson "github.com/zclconf/go-cty/cty/json"
)

// Returns the list of ARNs for all resources in the state file
func GetResourcesArn(path string) []string {
f, err := os.Open("terraform.tfstate")
if err != nil {
panic(err)
}

func GetResourcesArn(f io.Reader) []string {
result, err := Read(f)
if err != nil {
panic(err)
Expand Down

0 comments on commit 50a35d0

Please sign in to comment.