https://pulumi.com logo
#golang
Title
# golang
f

fancy-spoon-7206

07/18/2022, 4:07 PM
Is there a simple way to export a slice of a struct?
Copy code
type subnet struct {
		Id pulumi.StringOutput
		Az string
	}

	publicSubnet := make([]subnet, 0, 1)
	for index, az := range azs {
		publicSubnet = append(publicSubnet, subnet{
			Id: PublicSubnets.Index(<http://pulumi.Int|pulumi.Int>(index)),
			Az: az,
		})
	}
I would like to export publicSubnet, but that is not valid.
3 Views