Skip to content

Commit 50a35d0

Browse files
committed
changed input from file path to io.Reader
1 parent 672f04d commit 50a35d0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

external/states/statefile/resources.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
package statefile
22

33
import (
4+
"io"
5+
"sort"
6+
47
"github.com/kaytu-io/terraform-package/external/addrs"
58
"github.com/kaytu-io/terraform-package/external/configs/hcl2shim"
6-
"os"
7-
"sort"
89

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

1213
// Returns the list of ARNs for all resources in the state file
13-
func GetResourcesArn(path string) []string {
14-
f, err := os.Open("terraform.tfstate")
15-
if err != nil {
16-
panic(err)
17-
}
18-
14+
func GetResourcesArn(f io.Reader) []string {
1915
result, err := Read(f)
2016
if err != nil {
2117
panic(err)

0 commit comments

Comments
 (0)