Skip to content

Commit

Permalink
Made compatible with pull request adammck#31
Browse files Browse the repository at this point in the history
  • Loading branch information
lazartravica committed Apr 9, 2016
1 parent bec63f5 commit 44c888e
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ import (
"io"
)

func gatherResources(s *state) map[string][]string {
groups := make(map[string][]string, 0)
for _, res := range s.resources() {
for _, grp := range res.Groups() {
tmpGroup := []string{}

_, ok := groups[grp]
if ok {
tmpGroup = groups[grp].([]string)
}

tmpGroup = append(tmpGroup, res.Address())
groups[grp] = tmpGroup
func gatherResources(s *state) map[string]interface{} {
groups := make(map[string]interface{}, 0)
for _, res := range s.resources() {
for _, grp := range res.Groups() {

_, ok := groups[grp]
if !ok {
groups[grp] = []string{}
}

groups[grp] = append(groups[grp].([]string), res.Address())
}
}

if(len(s.outputs()) > 0) {
groups["all"] = make(map[string]string, 0)
Expand All @@ -45,7 +43,7 @@ func cmdInventory(stdout io.Writer, stderr io.Writer, s *state) int {
return 1;
}

for _, ress := range res {
for _, ress := range res.([]string) {

_, err := io.WriteString(stdout, ress + "\n")
if err != nil {
Expand Down

0 comments on commit 44c888e

Please sign in to comment.