Just having a go with Go and trying to figure it o...
# golang
f
Just having a go with Go and trying to figure it out. When creating a CustomComponent, I want to provide a list of strings to it as an input. Constructed this from some examples:
Copy code
type RepositoryArgs struct {
  Environments pulumi.StringArrayInput `pulumi:"environments"`
}
How do I iterate over
pulumi.StringArrayInput
? Like so?
Copy code
args.Environments.ToStringArrayOutput().ApplyT(func(environments []string) error { 
...
}
Should it be this or just
[]string
? What's the meaning of
pulumi:"environments"
here? Also, what's the meaning of this snippet? https://github.com/pulumi/examples/blob/master/aws-go-s3-folder-component/s3folder.go#L82-L90 Sorry. docs on this are really lean and there's not much in the examples either.
b
How do I iterate over pulumi.StringArrayInput?
yes you have to use an
ApplyT
right now
What's the meaning of pulumi:"environments" here?
I believe that's the schema model, if you're creating a multi language package it's needed, if it's just a plain pulumi component it's not
Also, what's the meaning of this snippet?
Arguments are things you pass to the your component, no idea what's happening in the snippet, looks out of date