pulumi/pkg/codegen/internal/test/testdata/external-resource-schema/go/example
Justin Van Patten a9f0aead13
[codegen/go] Fix Go resource registrations (#6641)
We've been emitting calls to `New<Resource>` for resource registrations
in Go, passing `nil` for args. However, some of those `New<Resource>`
functions actually check for `nil` args and return an error if the
resource has required arguments.

At first, I was looking for a way to check inside `New<Resource>` if
the `URN` option was specified and in that case not error on
`nil` args (like we do in other languages), but we don't provide a way
to access the resource option values outside the Go SDK), so I don't
think there is a way to do it this way for Go.

So instead, this change updates the registration code to call
`ctx.RegisterResource` directly instead of `New<Resource>`, where we can
pass a `nil` args.
2021-03-31 16:50:30 -06:00
..
argFunction.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
cat.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
component.go Fix test 2021-01-29 10:14:24 -08:00
doc.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
init.go [codegen/go] Fix Go resource registrations (#6641) 2021-03-31 16:50:30 -06:00
provider.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
pulumiTypes.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
pulumiUtilities.go Fix tests 2021-01-20 11:29:01 -08:00
workload.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00
workload_test.go Test data to cover types generated for external references 2021-01-20 11:29:01 -08:00