The stack state json looks like this ``` ...
# general
f
The stack state json looks like this
Copy code
"outputs": {
                        "privateSubnets": [
                            "subnet-0ef90f8900aa4e533",
                            "subnet-06e84b274ae517d39",
                            "subnet-01465b8f34f6490ee"
                        ],
                        "publicSubnets": [
                            "subnet-0c914a9aaec54e2a7",
                            "subnet-0893e2cfd9de09404",
                            "subnet-0216f9627f4fb20ef"
                        ],
                        "vpcId": "vpc-0f0e8a3ca9c7c8b41"
                    },
My intention is to count the number of private/public subnets. The data type of outputs is
map[string]interface{}
.
Copy code
for _, res := range stack.Deployment.Resources {
		privateSubnets := res.Outputs["privateSubnets"].(interface{})
		log.Infoln(privateSubnets.([]string))
    }
I would like to understand the type assertion to read through the values in the interface. Below is the error I get
Copy code
--- FAIL: TestInfrastructure (319.75s)
panic: interface conversion: interface {} is []interface {}, not []string [recovered]
        panic: interface conversion: interface {} is []interface {}, not []string